added on_order handler to entities and components, added visibility map

This commit is contained in:
2021-01-15 17:41:06 -06:00
parent e30d73d4d7
commit 19c5fc8d73
22 changed files with 164 additions and 51 deletions

View File

@@ -35,4 +35,15 @@ IMICRTS::Entity.define_entity(:refinery, :structure, 1_400, 200, "Generates cred
end
end
end
entity.on_order do |type, order|
case type
when IMICRTS::Order::CONSTRUCTION_COMPLETE
pos = entity.position.clone
pos.x += 32
pos.y += 64
entity.director.spawn_entity(player_id: entity.player.id, name: :harvester, position: pos)
end
end
end