Class: GameMachine::GameSystems::JsonModelPersistence
- Inherits:
-
Actor::Base
- Object
- JavaLib::GameActor
- Actor::Base
- GameMachine::GameSystems::JsonModelPersistence
- Includes:
- Commands
- Defined in:
- lib/game_machine/game_systems/json_model_persistence.rb
Constant Summary
Constants inherited from Actor::Base
Instance Method Summary collapse
Methods included from Commands
Methods inherited from Actor::Base
aspect, aspects, find, find_by_address, find_distributed, find_distributed_local, find_remote, hashring, local_path, model_filter, #onReceive, player_controller, #receive_message, #schedule_message, #sender, set_player_controller
Instance Method Details
#on_receive(message) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/game_machine/game_systems/json_model_persistence.rb', line 6 def on_receive() json_model = if json_model.id if json_model.id.match(/find_by_id/) id = json_model.id.sub('find_by_id','') if json_model = json_model.class.find(id) commands.player.(json_model,.player_id) end else json_model.save end else unhandled() end end |