Class: Gamefic::Engine::Tty

Inherits:
Base
  • Object
show all
Defined in:
lib/gamefic/engine/tty.rb

Overview

Note:

Due to their dependency on io/console, User::Tty and Engine::Tty are not included in the core Gamefic library. ‘require gamefic/tty` if you need them.

Extend Engine::Base to connect with User::Tty, which provides ANSI formatting for HTML.

Instance Attribute Summary

Attributes inherited from Base

#plot, #user_class

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#connect, #initialize, #receive, #run, #turn

Constructor Details

This class inherits a constructor from Gamefic::Engine::Base

Class Method Details

.start(plot) ⇒ Object



17
18
19
20
21
# File 'lib/gamefic/engine/tty.rb', line 17

def self.start plot
  engine = self.new(plot)
  engine.connect
  engine.run
end

Instance Method Details

#post_initializeObject



13
14
15
# File 'lib/gamefic/engine/tty.rb', line 13

def post_initialize
  self.user_class = Gamefic::User::Tty
end