mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-15 21:32:35 +00:00
Enable toggling simulation states debug draw
This commit is contained in:
@@ -23,7 +23,7 @@ module TAC
|
|||||||
self.send(:"draw_field_#{@season}")
|
self.send(:"draw_field_#{@season}")
|
||||||
|
|
||||||
@simulation.robots.each(&:draw)
|
@simulation.robots.each(&:draw)
|
||||||
@simulation.robots.each { |robot| robot.queue.first.draw if robot.queue.first }
|
@simulation.robots.each { |robot| robot.queue.first.draw if robot.queue.first && @simulation.show_paths }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
module TAC
|
module TAC
|
||||||
class Simulator
|
class Simulator
|
||||||
class Simulation
|
class Simulation
|
||||||
attr_reader :robots
|
attr_reader :robots, :show_paths
|
||||||
def initialize(source_code:, field_container:)
|
def initialize(source_code:, field_container:)
|
||||||
@source_code = source_code
|
@source_code = source_code
|
||||||
@field_container = field_container
|
@field_container = field_container
|
||||||
|
|
||||||
@robots = []
|
@robots = []
|
||||||
@field = Field.new(simulation: self, season: :skystone, container: @field_container)
|
@field = Field.new(simulation: self, season: :skystone, container: @field_container)
|
||||||
|
@show_paths = false
|
||||||
|
|
||||||
@last_milliseconds = Gosu.milliseconds
|
@last_milliseconds = Gosu.milliseconds
|
||||||
end
|
end
|
||||||
@@ -34,6 +35,10 @@ module TAC
|
|||||||
|
|
||||||
return robot
|
return robot
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_show_paths(boolean)
|
||||||
|
@show_paths = boolean
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user