Module: GamesAndRpgParadise::Lpc

Included in:
Checker, Geas::CharacterExclusion
Defined in:
lib/games_and_rpg_paradise/lpc/geas/forum.rb,
lib/games_and_rpg_paradise/lpc/geas/paths.rb,
lib/games_and_rpg_paradise/lpc/shell/shell.rb,
lib/games_and_rpg_paradise/lpc/shared/shared.rb,
lib/games_and_rpg_paradise/lpc/project/project.rb,
lib/games_and_rpg_paradise/lpc/constants/constants.rb,
lib/games_and_rpg_paradise/lpc/geas/forum_compacter.rb,
lib/games_and_rpg_paradise/lpc/geas/goblinoid_raids.rb,
lib/games_and_rpg_paradise/lpc/controller/controller.rb,
lib/games_and_rpg_paradise/lpc/geas/who_list_analyzer.rb,
lib/games_and_rpg_paradise/lpc/utility_scripts/checker.rb,
lib/games_and_rpg_paradise/lpc/geas/character_exclusion.rb,
lib/games_and_rpg_paradise/lpc/utility_scripts/knowledge_base.rb,
lib/games_and_rpg_paradise/lpc/utility_scripts/room_generator.rb,
lib/games_and_rpg_paradise/lpc/utility_scripts/query_character.rb

Overview

Lpc::Geas::Forum

Defined Under Namespace

Modules: Geas Classes: Checker, Controller, KnowledgeBase, QueryCharacter, RoomGenerator, Shell

Constant Summary collapse

PROJECT_BASE_DIRECTORY =
#

PROJECT_BASE_DIRECTORY

#
GamesAndRpgParadise.project_base_directory?+'lpc/'
N =
#

N

#
"\n"
DEFAULT_NAME =
#

DEFAULT_NAME

#
'generic_name'
RPG =
#

RPG

#
'/home/x/data/rpg/'
GEAS_YAML =
#

GEAS_YAML

#
RPG+'MUDS/GEAS/yaml/'
CHARS_PER_LINE =
#

CHARS_PER_LINE

#
78
CHARACTERS_IN_GUILDS =
#

CHARACTERS_IN_GUILDS

#
GEAS_YAML+'characters_in_guilds.yml'
SAVE_FILE =
#

SAVE_FILE

#
GEAS_YAML+'geas_webforum_activity_of_characters.yml'
FILE_GEAS_CHARACTER_EXCLUSION_DATA =
#

FILE_GEAS_CHARACTER_EXCLUSION_DATA

#
'/home/x/data/personal/rpg/muds/geas/yaml/character_exclusion_data.yml'
FILE_CHARACTER_DATASET =
FILE_GEAS_CHARACTER_EXCLUSION_DATA
CHARACTER_EXCLUSION_DATA =
#

CHARACTER_EXCLUSION_DATA

#
FILE_GEAS_CHARACTER_EXCLUSION_DATA
GEAS_CHARACTER_EXCLUSION_DATA =
CHARACTER_EXCLUSION_DATA
HASH_EXITS_EXPANDED =
#

HASH_EXITS_EXPANDED

This Hash keeps track of exit-types, e. g. n for north, s for south and so forth.

#
{
  'n'   => 'north',
  'ne'  => 'northeast',
  'e'   => 'east',
  'se'  => 'southeast',
  's'   => 'south',
  'sw'  => 'southwest',
  'w'   => 'west',
  'nw'  => 'northwest',
  'nd'  => 'northdown',
  'nu'  => 'northup',
  'su'  => 'southup',
  'wu'  => 'westup',
  'wd'  => 'westdown',
  'ed'  => 'eastdown',
  'eu'  => 'eastup',
  'd'   => 'down',
  'u'   => 'up',
  'ned' => 'northeastdown',
  'sed' => 'southeastdown',
  'swd' => 'southwestdown',
  'nwd' => 'northwestdown',
  'nwu' => 'northwestup',
  'swu' => 'southwestup'
}
HASH_OPPOSITE_EXITS =
#

HASH_OPPOSITE_EXITS

This hash can be used to get the opposite-exit to a room.

#
{
  'n'   => 's',
  'ne'  => 'sw',
  'e'   => 'w',
  'se'  => 'nw',
  's'   => 'n',
  'sw'  => 'ne',
  'w'   => 'e',
  'nw'  => 'se',
  'nd'  => 'su',
  'nu'  => 'sd',
  'su'  => 'nd',
  'wu'  => 'ed',
  'wd'  => 'eu',
  'ed'  => 'wu',
  'eu'  => 'wd',
  'd'   => 'u',
  'u'   => 'd',
  'ned' => 'swu',
  'sed' => 'nwu',
  'swd' => 'neu',
  'nwd' => 'seu',
  'nwu' => 'sed',
  'swu' => 'ned',
  'neu' => 'swd'    
}
HASH_LPC_TO_RUBY =
#

HASH_LPC_TO_RUBY

Simply provide a 1:1 mapping between LPC commands and Ruby commands

This is more a stub than something that really works “well”. The idea is to simply show some similarities between these two languages.

#
{
  'write_file'            => 'File.new()',
  'write_file(file_name)' => 'File.new(file_name)',
  'allocate'              => '[]',
  'allocate(x)'           => '[x]',
  'capitalize'            => 'capitalize',
  'capitalize(x)'         => 'x.capitalize',
  'ary[x]'                => 'array[x]',
  'mapping'               => '{}' # Aka a Hash.
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.add_lpc_comment(c) ⇒ Object

#

GamesAndRpgParadise::Lpc.add_lpc_comment

Use this method when generating a comment in LPC.

#


45
46
47
# File 'lib/games_and_rpg_paradise/lpc/shared/shared.rb', line 45

def self.add_lpc_comment(c)
  return " /* #{c} */"
end

.find_opposite_exit(i) ⇒ Object

#

GamesAndRpgParadise::Lpc.find_opposite_exit

As find_exit but give us the opposite. Works only for one input alone, so please split the input up before you call this function.

#


32
33
34
35
36
37
38
# File 'lib/games_and_rpg_paradise/lpc/shared/shared.rb', line 32

def self.find_opposite_exit(i)
  if HASH_OPPOSITE_EXITS.keys.include? i
    HASH_OPPOSITE_EXITS[i]
  else
    i
  end
end

.parse_forum_dataset(i) ⇒ Object

#

GamesAndRpgParadise::Lpc::Geas.parse_forum_dataset

#


103
104
105
# File 'lib/games_and_rpg_paradise/lpc/geas/forum_compacter.rb', line 103

def self.parse_forum_dataset(i)
  GamesAndRpgParadise::Lpc::Geas::ForumCompacter.new(i)
end

.project_base_dir?Boolean

#

Lpc.project_base_dir?

This method will refer to the above defined constant.

#

Returns:

  • (Boolean)


23
24
25
# File 'lib/games_and_rpg_paradise/lpc/project/project.rb', line 23

def self.project_base_dir?
  PROJECT_BASE_DIRECTORY
end

Instance Method Details

#revObject Also known as: main_colour?

#

rev

#


52
53
54
# File 'lib/games_and_rpg_paradise/lpc/shared/shared.rb', line 52

def rev
  Colours::GREEN
end

#warn(i) ⇒ Object

#

warn

#


59
60
61
# File 'lib/games_and_rpg_paradise/lpc/shared/shared.rb', line 59

def warn(i)
  e Colours::RED+i+Colours::GREEN
end