Module: Lomic

Defined in:
lib/lomic.rb,
lib/lomic/Rule.rb,
lib/lomic/Event.rb,
lib/lomic/GameState.rb,
lib/lomic/LomicBase.rb,
lib/lomic/EventEngine.rb,
lib/lomic/LomicParser.rb

Defined Under Namespace

Classes: Event, EventEngine, GameState, LomicBase, LomicParser, Rule

Constant Summary collapse

@@verbose =
false

Class Method Summary collapse

Class Method Details

.new_game(socket, filename) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/lomic.rb', line 13

def self.new_game(socket,filename)
  gstate = LomicParser.load_source(filename)
  puts 'Waiting for response from server...'
  first_event = socket.gets.strip!
  puts "Received first event: #{first_event}" if verbose?
  gstate.run(first_event,socket)
end

.verbose=(new_val) ⇒ Object



25
26
27
# File 'lib/lomic.rb', line 25

def self.verbose=(new_val)
  @@verbose = new_val
end

.verbose?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/lomic.rb', line 21

def self.verbose?
  @@verbose
end