Class: GameMachine::Actor::System
- Inherits:
-
Object
- Object
- GameMachine::Actor::System
- Defined in:
- server/lib/game_machine/actor/system.rb
Instance Attribute Summary collapse
-
#actor_system ⇒ Object
readonly
Returns the value of attribute actor_system.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #address ⇒ Object
- #config ⇒ Object
- #create! ⇒ Object
-
#initialize(name, config_str) ⇒ System
constructor
A new instance of System.
- #shutdown! ⇒ Object
Constructor Details
#initialize(name, config_str) ⇒ System
Returns a new instance of System.
7 8 9 10 |
# File 'server/lib/game_machine/actor/system.rb', line 7 def initialize(name,config_str) @config_str = config_str @name = name end |
Instance Attribute Details
#actor_system ⇒ Object (readonly)
Returns the value of attribute actor_system
6 7 8 |
# File 'server/lib/game_machine/actor/system.rb', line 6 def actor_system @actor_system end |
#name ⇒ Object (readonly)
Returns the value of attribute name
6 7 8 |
# File 'server/lib/game_machine/actor/system.rb', line 6 def name @name end |
Instance Method Details
#address ⇒ Object
12 13 14 |
# File 'server/lib/game_machine/actor/system.rb', line 12 def address actor_system.to_string end |
#config ⇒ Object
16 17 18 19 |
# File 'server/lib/game_machine/actor/system.rb', line 16 def config @config ||= JavaLib::ConfigFactory.parseString(@config_str). getConfig(name).withFallback(JavaLib::ConfigFactory.load) end |
#create! ⇒ Object
21 22 23 |
# File 'server/lib/game_machine/actor/system.rb', line 21 def create! @actor_system ||= JavaLib::ActorSystem.create(name, config) end |
#shutdown! ⇒ Object
25 26 27 28 |
# File 'server/lib/game_machine/actor/system.rb', line 25 def shutdown! actor_system.shutdown actor_system.await_termination end |