| 679 | } |
| 680 | |
| 681 | sp<Vehicle> City::createVehicle(GameState &state, StateRef<VehicleType> type, |
| 682 | StateRef<Organisation> owner) |
| 683 | { |
| 684 | auto v = mksp<Vehicle>(); |
| 685 | v->type = type; |
| 686 | v->name = format("%s %d", type->name, ++type->numCreated); |
| 687 | v->city = {&state, id}; |
| 688 | v->owner = owner; |
| 689 | v->health = type->health; |
| 690 | v->strategyImages = state.city_common_image_list->strategyImages; |
| 691 | v->owner = owner; |
| 692 | v->setupMover(); |
| 693 | |
| 694 | // Vehicle::equipDefaultEquipment uses the state reference from itself, so make sure the |
| 695 | // vehicle table has the entry before calling it |
| 696 | UString vID = Vehicle::generateObjectID(state); |
| 697 | state.vehicles[vID] = v; |
| 698 | |
| 699 | return v; |
| 700 | } |
| 701 | sp<Vehicle> City::createVehicle(GameState &state, StateRef<VehicleType> type, |
| 702 | StateRef<Organisation> owner, StateRef<Building> building) |
| 703 | { |
no test coverage detected