Module: Lich::Common::GameLoader
- Defined in:
- documented/common/game-loader.rb
Overview
Module responsible for loading game-specific resources.
Class Method Summary collapse
-
.common_after ⇒ void
Placeholder for any cleanup or finalization after loading.
-
.common_before ⇒ void
Loads common dependencies required for the game.
-
.dragon_realms ⇒ void
Loads all resources specific to the Dragon Realms game.
-
.gemstone ⇒ void
Loads all resources specific to the Gemstone game.
-
.load! ⇒ void
Loads the appropriate game based on the XMLData configuration.
Class Method Details
.common_after ⇒ void
This method returns an undefined value.
Placeholder for any cleanup or finalization after loading.
69 70 71 |
# File 'documented/common/game-loader.rb', line 69 def self.common_after # nil end |
.common_before ⇒ void
This method returns an undefined value.
Loads common dependencies required for the game.
10 11 12 13 14 15 16 |
# File 'documented/common/game-loader.rb', line 10 def self.common_before require File.join(LIB_DIR, 'common', 'log.rb') require File.join(LIB_DIR, 'common', 'spell.rb') require File.join(LIB_DIR, 'util', 'util.rb') require File.join(LIB_DIR, 'util', 'textstripper.rb') require File.join(LIB_DIR, 'common', 'hmr.rb') end |
.dragon_realms ⇒ void
This method returns an undefined value.
Loads all resources specific to the Dragon Realms game.
58 59 60 61 62 63 64 65 |
# File 'documented/common/game-loader.rb', line 58 def self.dragon_realms self.common_before require File.join(LIB_DIR, 'common', 'map', 'map_dr.rb') require File.join(LIB_DIR, 'attributes', 'char.rb') require File.join(LIB_DIR, 'dragonrealms', 'drinfomon.rb') require File.join(LIB_DIR, 'dragonrealms', 'commons.rb') self.common_after end |
.gemstone ⇒ void
This method returns an undefined value.
Loads all resources specific to the Gemstone game.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'documented/common/game-loader.rb', line 20 def self.gemstone self.common_before require File.join(LIB_DIR, 'gemstone', 'sk.rb') require File.join(LIB_DIR, 'common', 'map', 'map_gs.rb') require File.join(LIB_DIR, 'gemstone', 'effects.rb') require File.join(LIB_DIR, 'gemstone', 'bounty.rb') require File.join(LIB_DIR, 'gemstone', 'claim.rb') require File.join(LIB_DIR, 'gemstone', 'infomon.rb') require File.join(LIB_DIR, 'attributes', 'resources.rb') require File.join(LIB_DIR, 'attributes', 'stats.rb') require File.join(LIB_DIR, 'attributes', 'spells.rb') require File.join(LIB_DIR, 'attributes', 'skills.rb') require File.join(LIB_DIR, 'gemstone', 'society.rb') require File.join(LIB_DIR, 'gemstone', 'infomon', 'status.rb') require File.join(LIB_DIR, 'gemstone', 'experience.rb') require File.join(LIB_DIR, 'attributes', 'spellsong.rb') require File.join(LIB_DIR, 'gemstone', 'infomon', 'activespell.rb') require File.join(LIB_DIR, 'gemstone', 'psms.rb') require File.join(LIB_DIR, 'attributes', 'char.rb') require File.join(LIB_DIR, 'gemstone', 'infomon', 'currency.rb') # require File.join(LIB_DIR, 'gemstone', 'character', 'disk.rb') # dup require File.join(LIB_DIR, 'gemstone', 'group.rb') require File.join(LIB_DIR, 'gemstone', 'critranks') require File.join(LIB_DIR, 'gemstone', 'injured') require File.join(LIB_DIR, 'gemstone', 'wounds.rb') require File.join(LIB_DIR, 'gemstone', 'scars.rb') require File.join(LIB_DIR, 'gemstone', 'gift.rb') # require File.join(LIB_DIR, 'gemstone', 'creature.rb') # combat tracker below loads this so not needed to preload require File.join(LIB_DIR, 'gemstone', 'combat', 'tracker.rb') require File.join(LIB_DIR, 'gemstone', 'readylist.rb') require File.join(LIB_DIR, 'gemstone', 'stowlist.rb') require File.join(LIB_DIR, 'gemstone', 'armaments.rb') ActiveSpell.watch! self.common_after end |
.load! ⇒ void
This method returns an undefined value.
Loads the appropriate game based on the XMLData configuration.
78 79 80 81 82 83 |
# File 'documented/common/game-loader.rb', line 78 def self.load! sleep 0.1 while XMLData.game.nil? or XMLData.game.empty? return self.dragon_realms if XMLData.game =~ /DR/ return self.gemstone if XMLData.game =~ /GS/ echo "could not load game specifics for %s" % XMLData.game end |