Class: Lich::GameBase::GameInstance::Base

Inherits:
Object
  • Object
show all
Defined in:
documented/games.rb

Overview

Base instance class that defines the interface Base instance class that defines the interface This class provides the basic structure for game instances

Examples:

Subclassing Base

class MyGameInstance < GameInstance::Base
  def clean_serverstring(server_string)
    # Implementation here
  end
end

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



78
79
80
81
82
# File 'documented/games.rb', line 78

def initialize
  @atmospherics = false
  @combat_count = 0
  @end_combat_tags = ["<prompt", "<clearStream", "<component", "<pushStream id=\"percWindow"]
end

Instance Method Details

#atmosphericsObject



116
117
118
# File 'documented/games.rb', line 116

def atmospherics
  @atmospherics
end

#atmospherics=(value) ⇒ Object



120
121
122
# File 'documented/games.rb', line 120

def atmospherics=(value)
  @atmospherics = value
end

#clean_serverstring(server_string) ⇒ Object

Raises:

  • (NotImplementedError)


84
85
86
# File 'documented/games.rb', line 84

def clean_serverstring(server_string)
  raise NotImplementedError, "#{self.class} must implement #clean_serverstring"
end

#combat_countObject



112
113
114
# File 'documented/games.rb', line 112

def combat_count
  @combat_count
end

#get_documentation_urlObject

Raises:

  • (NotImplementedError)


96
97
98
# File 'documented/games.rb', line 96

def get_documentation_url
  raise NotImplementedError, "#{self.class} must implement #get_documentation_url"
end

#handle_atmospherics(server_string) ⇒ Object

Raises:

  • (NotImplementedError)


92
93
94
# File 'documented/games.rb', line 92

def handle_atmospherics(server_string)
  raise NotImplementedError, "#{self.class} must implement #handle_atmospherics"
end

#handle_combat_tags(server_string) ⇒ Object

Raises:

  • (NotImplementedError)


88
89
90
# File 'documented/games.rb', line 88

def handle_combat_tags(server_string)
  raise NotImplementedError, "#{self.class} must implement #handle_combat_tags"
end

#increment_combat_count(server_string) ⇒ Object (protected)



126
127
128
129
130
# File 'documented/games.rb', line 126

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) ⇒ Object

Raises:

  • (NotImplementedError)


104
105
106
# File 'documented/games.rb', line 104

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) ⇒ Object

Raises:

  • (NotImplementedError)


100
101
102
# File 'documented/games.rb', line 100

def process_game_specific_data(server_string)
  raise NotImplementedError, "#{self.class} must implement #process_game_specific_data"
end

#process_room_display(alt_string) ⇒ Object

Raises:

  • (NotImplementedError)


108
109
110
# File 'documented/games.rb', line 108

def process_room_display(alt_string)
  raise NotImplementedError, "#{self.class} must implement #process_room_display"
end