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