mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-14 07:12:34 +00:00
Stubbed Connection, added #next_entity_id to Player, made Director store and pass to Player the current_tick
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
class IMICRTS
|
||||
class Player
|
||||
attr_reader :id, :name, :entities, :orders, :camera
|
||||
attr_reader :selected_entities
|
||||
def initialize(id:, name: nil)
|
||||
@id = id
|
||||
@name = name ? name : "Novice-#{id}"
|
||||
@@ -8,13 +9,20 @@ class IMICRTS
|
||||
@entities = []
|
||||
@orders = []
|
||||
@camera = Camera.new
|
||||
|
||||
@selected_entities = []
|
||||
@current_entity_id = 0
|
||||
end
|
||||
|
||||
def tick
|
||||
puts "Player #{@id}-#{@name} ticked: #{Gosu.milliseconds}"
|
||||
def tick(tick_id)
|
||||
end
|
||||
|
||||
def entity(id)
|
||||
@entities.find { |ent| ent.id == id }
|
||||
end
|
||||
|
||||
def next_entity_id
|
||||
@current_entity_id += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user