Class: Gamefic::Mud::State::Play
- Defined in:
- lib/gamefic-mud/state/play.rb
Overview
The typical gameplay handler. This state processes client messages as commands to be executed by the player’s character.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Gamefic::Mud::State::Base
Instance Method Details
#process(message) ⇒ Object
16 17 18 |
# File 'lib/gamefic-mud/state/play.rb', line 16 def process adapter.character.queue.push unless == '' end |
#start ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/gamefic-mud/state/play.rb', line 8 def start adapter.plot.introduce adapter.character # Since the game is already running when the player connects, the # plot update flushes messages received in the introduction. We're # working around the problem by sending them here. adapter.update({ messages: adapter.character. }) end |