Stubbed Connection, added #next_entity_id to Player, made Director store and pass to Player the current_tick

This commit is contained in:
2019-10-03 10:40:57 -05:00
parent 8be63d8ebe
commit 3dd067612a
6 changed files with 39 additions and 12 deletions

View File

@@ -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