28#define MAX_PRODUCTIONS 40
30#define MAX_PRODUCTION_AMOUNT 500
50 struct storedUFO_s*
ufo;
59typedef struct production_s
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)
90typedef struct production_queue_s
96#define PR_GetProductionForBase(base) (&((base)->productions))
void PR_ProductionRun(void)
Checks whether an item is finished.
const char * PR_GetName(const productionData_t *data)
void PR_UpdateProductionCap(struct base_s *base, int workerChange=0)
int PR_GetPrice(const int productionCost)
Used in production costs (to allow reducing prices below 1x).
production_t * PR_QueueNew(struct base_s *base, const productionData_t *data, signed int amount)
int PR_DecreaseProduction(production_t *prod, int amount)
decreases production amount
@ PRODUCTION_TYPE_DISASSEMBLY
@ PRODUCTION_TYPE_AIRCRAFT
int PR_GetRemainingMinutes(const production_t *prod)
Calculates the remaining time for a technology in minutes.
int PR_IncreaseProduction(production_t *prod, int amount)
increases production amount if possible
void PR_UpdateRequiredItemsInBasestorage(struct base_s *base, int amount, const requirements_t *reqs)
int PR_RequirementsMet(int amount, const requirements_t *reqs, struct base_s *base)
int PR_GetRemainingHours(const production_t *prod)
Calculates the remaining hours for a technology.
struct base_s * PR_ProductionBase(const production_t *production)
Returns the base pointer the production belongs to.
void PR_QueueNext(struct base_s *base)
void PR_QueueDelete(struct base_s *base, production_queue_t *queue, int index)
void PR_ProductionInit(void)
int PR_GetProductionHours(const struct base_s *base, const productionData_t *prodData)
void PR_QueueMove(production_queue_t *queue, int index, int dir)
Moves the given queue item in the given direction.
technology_t * PR_GetTech(const productionData_t *data)
#define MAX_PRODUCTIONS
Maximum number of productions queued in any one base.
bool PR_ItemIsProduceable(const objDef_t *item)
check if an item is producable.
int PR_WorkersAvailable(const struct base_s *base)
QGL_EXTERN GLsizei const GLvoid * data
Defines all attributes of objects used in the inventory.
A production queue. Lists all items to be produced.
struct production_s items[MAX_PRODUCTIONS]
Holds all information for the production of one item-type.
This is the technology parsed from research.ufo.
const struct aircraft_s * aircraft