Moved entity selection/order giving into EntityController

This commit is contained in:
2019-11-21 10:21:25 -06:00
parent fa0eabd52f
commit 637708dd5a
6 changed files with 142 additions and 109 deletions

View File

@@ -100,6 +100,18 @@ class IMICRTS
end
end
def spawn_entity(player_id:, name:, position:)
_player = player(player_id)
_player.entities << Entity.new(
name: name,
director: self,
player: _player,
id: _player.next_entity_id,
position: position,
angle: 0
)
end
def entities
@players.map { |player| player.entities }.flatten