mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-15 15:52:34 +00:00
Moved entity selection/order giving into EntityController
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user