149
149
Workers get_incorporated_workers();
151
void insert_wares (WareIndex, uint32_t count);
152
void remove_wares (WareIndex, uint32_t count);
153
void insert_workers(WareIndex, uint32_t count);
154
void remove_workers(WareIndex, uint32_t count);
151
void insert_wares (DescriptionIndex, uint32_t count);
152
void remove_wares (DescriptionIndex, uint32_t count);
153
void insert_workers(DescriptionIndex, uint32_t count);
154
void remove_workers(DescriptionIndex, uint32_t count);
156
156
/* SoldierControl implementation */
157
157
std::vector<Soldier *> present_soldiers() const override;
173
173
bool fetch_from_flag(Game &) override;
175
uint32_t count_workers(const Game &, WareIndex, const Requirements &);
176
Worker & launch_worker(Game &, WareIndex, const Requirements &);
175
uint32_t count_workers(const Game &, DescriptionIndex, const Requirements &);
176
Worker & launch_worker(Game &, DescriptionIndex, const Requirements &);
178
178
// Adds the worker to the inventory. Takes ownership and might delete
180
180
void incorporate_worker(EditorGameBase&, Worker* worker);
182
WareInstance & launch_ware(Game &, WareIndex);
182
WareInstance & launch_ware(Game &, DescriptionIndex);
183
183
bool do_launch_ware(Game &, WareInstance &);
185
185
// Adds the ware to our inventory. Takes ownership and might delete 'ware'.
186
186
void incorporate_ware(EditorGameBase&, WareInstance* ware);
188
bool can_create_worker(Game &, WareIndex) const;
189
void create_worker(Game &, WareIndex);
188
bool can_create_worker(Game &, DescriptionIndex) const;
189
void create_worker(Game &, DescriptionIndex);
191
uint32_t get_planned_workers(Game &, WareIndex index) const;
192
void plan_workers(Game &, WareIndex index, uint32_t amount);
191
uint32_t get_planned_workers(Game &, DescriptionIndex index) const;
192
void plan_workers(Game &, DescriptionIndex index, uint32_t amount);
193
193
std::vector<uint32_t> calc_available_for_worker
194
(Game &, WareIndex index) const;
194
(Game &, DescriptionIndex index) const;
196
196
void enable_spawn(Game &, uint8_t worker_types_without_cost_index);
197
197
void disable_spawn(uint8_t worker_types_without_cost_index);
203
203
bool attack (Soldier &) override;
204
204
// End Attackable implementation
206
void receive_ware(Game &, WareIndex ware) override;
206
void receive_ware(Game &, DescriptionIndex ware) override;
207
207
void receive_worker(Game &, Worker & worker) override;
209
StockPolicy get_ware_policy(WareIndex ware) const;
210
StockPolicy get_worker_policy(WareIndex ware) const;
211
StockPolicy get_stock_policy(WareWorker waretype, WareIndex wareindex) const;
212
void set_ware_policy(WareIndex ware, StockPolicy policy);
213
void set_worker_policy(WareIndex ware, StockPolicy policy);
209
StockPolicy get_ware_policy(DescriptionIndex ware) const;
210
StockPolicy get_worker_policy(DescriptionIndex ware) const;
211
StockPolicy get_stock_policy(WareWorker waretype, DescriptionIndex wareindex) const;
212
void set_ware_policy(DescriptionIndex ware, StockPolicy policy);
213
void set_worker_policy(DescriptionIndex ware, StockPolicy policy);
215
215
// Get the portdock if this is a port.
216
216
PortDock * get_portdock() const {return m_portdock;}
218
218
// Returns the waresqueue of the expedition if this is a port. Will
219
219
// assert(false) otherwise.
220
WaresQueue& waresqueue(WareIndex) override;
220
WaresQueue& waresqueue(DescriptionIndex) override;
222
222
void log_general_info(const EditorGameBase &) override;
252
252
static void request_cb
253
(Game &, Request &, WareIndex, Worker *, PlayerImmovable &);
253
(Game &, Request &, DescriptionIndex, Worker *, PlayerImmovable &);
254
254
void check_remove_stock(Game &);
256
256
bool _load_finish_planned_worker(PlannedWorkers & pw);
265
265
// Workers who live here at the moment
266
266
using WorkerList = std::vector<Worker *>;
267
using IncorporatedWorkers = std::map<WareIndex, WorkerList>;
267
using IncorporatedWorkers = std::map<DescriptionIndex, WorkerList>;
268
268
IncorporatedWorkers m_incorporated_workers;
269
269
std::vector<Time> m_next_worker_without_cost_spawn;
270
270
Time m_next_military_act;