Module: Lich::GameBase::GameInstanceFactory
- Defined in:
- documented/games.rb
Overview
Factory for creating game-specific objects
Class Method Summary collapse
-
.create(game_type) ⇒ Lich::GameBase::GameInstance::Base
private
Factory method that instantiates a game-specific handler.
Class Method Details
.create(game_type) ⇒ Lich::GameBase::GameInstance::Base
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Factory method that instantiates a game-specific handler.
Dispatches on the game type ("GS" for GemStone, "DR" for DragonRealms) and returns the appropriate GameInstance subclass. Falls back to a basic no-op implementation if the game type is unknown.
179 180 181 182 183 184 185 186 187 188 189 |
# File 'documented/games.rb', line 179 def self.create(game_type) case game_type when /^GS/ Gemstone::GameInstance.new when /^DR/ DragonRealms::GameInstance.new else # Default to a basic implementation if game type is unknown GameInstance::Base.new end end |