class Gamefic::Mud::State::Base

An abstract class for handling client states.

Attributes

adapter[R]

@return [Adapter::Common]

Public Class Methods

new(adapter) click to toggle source

@param adapter [Adapter::Common]

# File lib/gamefic-mud/state/base.rb, line 11
def initialize adapter
  @adapter = adapter
end

Public Instance Methods

process(message) click to toggle source

Called when a message is received from a client. Subclasses should implement this method.

@param message [String] @return [void]

# File lib/gamefic-mud/state/base.rb, line 28
def process message
  puts "User sent #{message} in #{self.class}"
end
start() click to toggle source

Called when a client's state changes. Subclasses should implement this method.

@return [void]

# File lib/gamefic-mud/state/base.rb, line 19
def start
  puts "User started #{self.class}"
end