Class: Lich::GameBase::GameInstance::Base
- Inherits:
-
Object
- Object
- Lich::GameBase::GameInstance::Base
- Defined in:
- documented/games.rb
Overview
Base class for game instances This class provides common functionality for all game instances.
Direct Known Subclasses
Instance Method Summary collapse
- #atmospherics ⇒ Object
- #atmospherics=(value) ⇒ Object
-
#clean_serverstring(server_string) ⇒ String
Cleans the server string for processing.
- #combat_count ⇒ Object
-
#get_documentation_url ⇒ String
Retrieves the documentation URL for the game instance.
-
#handle_atmospherics(server_string) ⇒ String
Handles atmospherics in the server string.
-
#handle_combat_tags(server_string) ⇒ String
Handles combat tags in the server string.
- #increment_combat_count(server_string) ⇒ Object protected
-
#initialize ⇒ Base
constructor
A new instance of Base.
-
#modify_room_display(alt_string, uid_from_string, lichid_from_uid_string) ⇒ String
Modifies the room display string.
-
#process_game_specific_data(server_string) ⇒ void
Processes game-specific data from the server string.
-
#process_room_display(alt_string) ⇒ String
Processes the room display string.
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
39 40 41 42 43 |
# File 'documented/games.rb', line 39 def initialize @atmospherics = false @combat_count = 0 @end_combat_tags = ["<prompt", "<clearStream", "<component", "<pushStream id=\"percWindow"] end |
Instance Method Details
#atmospherics ⇒ Object
118 119 120 |
# File 'documented/games.rb', line 118 def atmospherics @atmospherics end |
#atmospherics=(value) ⇒ Object
122 123 124 |
# File 'documented/games.rb', line 122 def atmospherics=(value) @atmospherics = value end |
#clean_serverstring(server_string) ⇒ String
Cleans the server string for processing
51 52 53 |
# File 'documented/games.rb', line 51 def clean_serverstring(server_string) raise NotImplementedError, "#{self.class} must implement #clean_serverstring" end |
#combat_count ⇒ Object
114 115 116 |
# File 'documented/games.rb', line 114 def combat_count @combat_count end |
#get_documentation_url ⇒ String
Retrieves the documentation URL for the game instance
80 81 82 |
# File 'documented/games.rb', line 80 def get_documentation_url raise NotImplementedError, "#{self.class} must implement #get_documentation_url" end |
#handle_atmospherics(server_string) ⇒ String
Handles atmospherics in the server string
71 72 73 |
# File 'documented/games.rb', line 71 def handle_atmospherics(server_string) raise NotImplementedError, "#{self.class} must implement #handle_atmospherics" end |
#handle_combat_tags(server_string) ⇒ String
Handles combat tags in the server string
61 62 63 |
# File 'documented/games.rb', line 61 def (server_string) raise NotImplementedError, "#{self.class} must implement #handle_combat_tags" end |
#increment_combat_count(server_string) ⇒ Object (protected)
128 129 130 131 132 |
# File 'documented/games.rb', line 128 def increment_combat_count(server_string) @combat_count += server_string.scan("<pushStream id=\"combat\" />").length @combat_count -= server_string.scan("<popStream id=\"combat\" />").length @combat_count = 0 if @combat_count < 0 end |
#modify_room_display(alt_string, uid_from_string, lichid_from_uid_string) ⇒ String
Modifies the room display string
100 101 102 |
# File 'documented/games.rb', line 100 def modify_room_display(alt_string, uid_from_string, lichid_from_uid_string) raise NotImplementedError, "#{self.class} must implement #modify_room_display" end |
#process_game_specific_data(server_string) ⇒ void
This method returns an undefined value.
Processes game-specific data from the server string
90 91 92 |
# File 'documented/games.rb', line 90 def process_game_specific_data(server_string) raise NotImplementedError, "#{self.class} must implement #process_game_specific_data" end |
#process_room_display(alt_string) ⇒ String
Processes the room display string
110 111 112 |
# File 'documented/games.rb', line 110 def process_room_display(alt_string) raise NotImplementedError, "#{self.class} must implement #process_room_display" end |