28 #define MAX_PRODUCTIONS 40
30 #define MAX_PRODUCTION_AMOUNT 500
70 #define PR_IsDisassemblyData(data) ((data)->type == PRODUCTION_TYPE_DISASSEMBLY)
71 #define PR_IsAircraftData(data) ((data)->type == PRODUCTION_TYPE_AIRCRAFT)
72 #define PR_IsItemData(data) ((data)->type == PRODUCTION_TYPE_ITEM)
73 #define PR_IsProductionData(data) (!PR_IsDisassemblyData(data))
75 #define PR_IsDisassembly(prod) (PR_IsDisassemblyData(&(prod)->data))
76 #define PR_IsAircraft(prod) (PR_IsAircraftData(&(prod)->data))
77 #define PR_IsItem(prod) (PR_IsItemData(&(prod)->data))
78 #define PR_IsProduction(prod) (!PR_IsDisassembly(prod))
80 #define PR_SetData(dataPtr, typeVal, ptr) do { assert(ptr); (dataPtr)->data.pointer = (ptr); (dataPtr)->type = (typeVal); } while (0);
81 #define PR_IsDataValid(dataPtr) ((dataPtr)->data.pointer != nullptr)
83 #define PR_GetProgress(prod) ((double)(prod)->frame / (prod)->totalFrames)
84 #define PR_IsReady(prod) ((prod)->frame > (prod)->totalFrames)
96 #define PR_GetProductionForBase(base) (&((base)->productions))
void PR_UpdateRequiredItemsInBasestorage(struct base_s *base, int amount, const requirements_t *reqs)
Remove or add the required items from/to the a base.
bool PR_ItemIsProduceable(const objDef_t *item)
check if an item is producable.
int PR_GetRemainingMinutes(const production_t *prod)
Calculates the remaining time for a technology in minutes.
int PR_DecreaseProduction(production_t *prod, int amount)
decreases production amount
technology_t * PR_GetTech(const productionData_t *data)
int PR_RequirementsMet(int amount, const requirements_t *reqs, struct base_s *base)
Checks if the production requirements are met for a defined amount.
int PR_GetPrice(const int productionCost)
Used in production costs (to allow reducing prices below 1x).
Defines all attributes of objects used in the inventory.
void PR_ProductionInit(void)
A base with all it's data.
A production queue. Lists all items to be produced.
struct production_s production_t
Holds all information for the production of one item-type.
int PR_GetRemainingHours(const production_t *prod)
Calculates the remaining hours for a technology.
void PR_ProductionRun(void)
Checks whether an item is finished.
struct production_queue_s production_queue_t
A production queue. Lists all items to be produced.
Structure for stored UFOs.
const char * PR_GetName(const productionData_t *data)
int PR_GetProductionHours(const struct base_s *base, const productionData_t *prodData)
int PR_IncreaseProduction(production_t *prod, int amount)
increases production amount if possible
This is the technology parsed from research.ufo.
void PR_QueueDelete(struct base_s *base, production_queue_t *queue, int index)
Delete the selected entry from the queue.
void PR_QueueNext(struct base_s *base)
Queues the next production in the queue.
int PR_WorkersAvailable(const struct base_s *base)
production_t * PR_QueueNew(struct base_s *base, const productionData_t *data, signed int amount)
Add a new item to the bottom of the production queue.
void PR_QueueMove(production_queue_t *queue, int index, int dir)
Moves the given queue item in the given direction.
struct production_s items[MAX_PRODUCTIONS]
#define MAX_PRODUCTIONS
Maximum number of productions queued in any one base.
const struct aircraft_s * aircraft
struct base_s * PR_ProductionBase(const production_t *production)
Returns the base pointer the production belongs to.
void PR_UpdateProductionCap(struct base_s *base, int workerChange=0)
Update the current capacity of Workshop.
GLsizei const GLvoid * data
An aircraft with all it's data.
Holds all information for the production of one item-type.