Class: GameMachine::Commands::MiscCommands

Inherits:
Object
  • Object
show all
Defined in:
lib/game_machine/commands/misc_commands.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMiscCommands

Returns a new instance of MiscCommands.



6
7
8
9
# File 'lib/game_machine/commands/misc_commands.rb', line 6

def initialize
  @mono_proxy = JavaLib::MonoProxy.getInstance
  @player_manager = Application.config.player_manager
end

Instance Attribute Details

#mono_proxyObject (readonly)

Returns the value of attribute mono_proxy.



5
6
7
# File 'lib/game_machine/commands/misc_commands.rb', line 5

def mono_proxy
  @mono_proxy
end

#player_managerObject (readonly)

Returns the value of attribute player_manager.



5
6
7
# File 'lib/game_machine/commands/misc_commands.rb', line 5

def player_manager
  @player_manager
end

Instance Method Details

#call_mono(klass, message) ⇒ Object



11
12
13
# File 'lib/game_machine/commands/misc_commands.rb', line 11

def call_mono(klass,message)
  mono_proxy.call(klass,message)
end

#client_manager_register(name, events = []) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/game_machine/commands/misc_commands.rb', line 15

def client_manager_register(name,events=[])
  register = MessageLib::ClientManagerRegister.new.
    set_register_type('actor').set_name(name).set_events(events.join('|'))
  entity = MessageLib::Entity.new.set_id(name).
    set_client_manager_register(register)
  ClientManager.find.ask(entity,5000)
end