mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-15 07:42:34 +00:00
19 lines
436 B
Ruby
19 lines
436 B
Ruby
class IMICRTS
|
|
class Spawner < Component
|
|
def tick(tick_id)
|
|
item = @parent.component(:build_queue).queue.first
|
|
|
|
return unless item
|
|
|
|
item.progress += 1
|
|
|
|
if item.progress >= item.entity.build_steps
|
|
unless item.completed
|
|
item.completed = true
|
|
|
|
@parent.director.schedule_order(IMICRTS::Order::BUILD_UNIT_COMPLETE, @parent.player.id, @parent.id)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end |