|
UFO: Alien Invasion
|
Header for production related stuff. More...

Go to the source code of this file.
Data Structures | |
| struct | productionData_t |
| union | productionData_t::productionItem_t |
| struct | production_t |
| Holds all information for the production of one item-type. More... | |
| struct | production_queue_t |
| A production queue. Lists all items to be produced. More... | |
Macros | |
| #define | MAX_PRODUCTIONS 40 |
| Maximum number of productions queued in any one base. | |
| #define | MAX_PRODUCTION_AMOUNT 500 |
| #define | UGV_SIZE 300 |
| #define | PR_IsDisassemblyData(data) |
| #define | PR_IsAircraftData(data) |
| #define | PR_IsItemData(data) |
| #define | PR_IsProductionData(data) |
| #define | PR_IsDisassembly(prod) |
| #define | PR_IsAircraft(prod) |
| #define | PR_IsItem(prod) |
| #define | PR_IsProduction(prod) |
| #define | PR_SetData(dataPtr, typeVal, ptr) |
| #define | PR_IsDataValid(dataPtr) |
| #define | PR_GetProgress(prod) |
| #define | PR_IsReady(prod) |
| #define | PR_GetProductionForBase(base) |
Enumerations | |
| enum | productionType_t { PRODUCTION_TYPE_ITEM , PRODUCTION_TYPE_AIRCRAFT , PRODUCTION_TYPE_DISASSEMBLY , PRODUCTION_TYPE_MAX } |
Functions | |
| int | PR_GetPrice (const int productionCost) |
| Used in production costs (to allow reducing prices below 1x). | |
| void | PR_ProductionInit (void) |
| void | PR_ProductionRun (void) |
| Checks whether an item is finished. | |
| bool | PR_ItemIsProduceable (const objDef_t *item) |
| check if an item is producable. | |
| struct base_s * | PR_ProductionBase (const production_t *production) |
| Returns the base pointer the production belongs to. | |
| int | PR_IncreaseProduction (production_t *prod, int amount) |
| increases production amount if possible | |
| int | PR_DecreaseProduction (production_t *prod, int amount) |
| decreases production amount | |
| const char * | PR_GetName (const productionData_t *data) |
| technology_t * | PR_GetTech (const productionData_t *data) |
| void | PR_UpdateProductionCap (struct base_s *base, int workerChange=0) |
| 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_WorkersAvailable (const struct base_s *base) |
| int | PR_GetRemainingMinutes (const production_t *prod) |
| Calculates the remaining time for a technology in minutes. | |
| int | PR_GetRemainingHours (const production_t *prod) |
| Calculates the remaining hours for a technology. | |
| int | PR_GetProductionHours (const struct base_s *base, const productionData_t *prodData) |
| 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. | |
| void | PR_QueueDelete (struct base_s *base, production_queue_t *queue, int index) |
| void | PR_QueueNext (struct base_s *base) |
Header for production related stuff.
Definition in file cp_produce.h.
| #define MAX_PRODUCTION_AMOUNT 500 |
Maximum number of produced items.
Definition at line 30 of file cp_produce.h.
Referenced by PR_IncreaseProduction(), and PR_ProductionIncrease_f().
| #define MAX_PRODUCTIONS 40 |
Maximum number of productions queued in any one base.
Definition at line 28 of file cp_produce.h.
Referenced by PR_LoadXML(), PR_ProductionBase(), and PR_QueueNew().
| #define PR_GetProductionForBase | ( | base | ) |
Definition at line 96 of file cp_produce.h.
Referenced by PR_DecreaseProduction(), PR_EmptyQueue(), PR_LoadXML(), PR_PostLoadInitProgress(), PR_ProductionBase(), PR_ProductionDown_f(), PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_ProductionRollBottom(), PR_ProductionRun(), PR_ProductionStop_f(), PR_ProductionType_f(), PR_ProductionUp_f(), PR_QueueNew(), PR_QueueNext(), PR_SaveXML(), PR_ShowActiveProduction_f(), PR_UpdateProductionCap(), PR_UpdateProductionList(), and US_RemoveStoredUFO().
| #define PR_GetProgress | ( | prod | ) |
Definition at line 83 of file cp_produce.h.
Referenced by PR_ShowActiveProduction_f().
| #define PR_IsAircraft | ( | prod | ) |
Definition at line 76 of file cp_produce.h.
Referenced by PR_CheckFrame(), PR_FinishProduction(), PR_ProductionIncrease_f(), PR_ProductionInfo(), PR_SaveXML(), and PR_UpdateProductionList().
| #define PR_IsAircraftData | ( | data | ) |
Definition at line 71 of file cp_produce.h.
Referenced by PR_ProductionIncrease_f(), and PR_ProductionInfo().
| #define PR_IsDataValid | ( | dataPtr | ) |
Definition at line 81 of file cp_produce.h.
Referenced by PR_LoadXML(), PR_ProductionChange_f(), PR_ProductionIncrease_f(), and PR_ProductionInfo().
| #define PR_IsDisassembly | ( | prod | ) |
Definition at line 75 of file cp_produce.h.
Referenced by PR_DecreaseProduction(), PR_IncreaseProduction(), PR_ProductionIncrease_f(), PR_ProductionInfo(), PR_ProductionRun(), PR_ResetUFODisassembly(), PR_SaveXML(), PR_SetUFODisassembly(), and PR_UpdateProductionList().
| #define PR_IsDisassemblyData | ( | data | ) |
Definition at line 70 of file cp_produce.h.
Referenced by PR_ProductionInfo(), and PR_QueueNew().
| #define PR_IsItem | ( | prod | ) |
Definition at line 77 of file cp_produce.h.
Referenced by PR_CheckFrame(), PR_FinishProduction(), PR_ProductionInfo(), PR_SaveXML(), and PR_UpdateProductionList().
| #define PR_IsItemData | ( | data | ) |
Definition at line 72 of file cp_produce.h.
Referenced by PR_ProductionInfo().
| #define PR_IsProduction | ( | prod | ) |
Definition at line 78 of file cp_produce.h.
Referenced by PR_ProductionRun().
| #define PR_IsProductionData | ( | data | ) |
Definition at line 73 of file cp_produce.h.
Referenced by PR_CalculateTotalFrames().
| #define PR_IsReady | ( | prod | ) |
Definition at line 84 of file cp_produce.h.
Referenced by PR_ProductionRun().
| #define PR_SetData | ( | dataPtr, | |
| typeVal, | |||
| ptr ) |
Definition at line 80 of file cp_produce.h.
Referenced by PR_LoadXML(), PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_ProductionType_f(), TEST_F(), TEST_F(), and TEST_F().
| #define UGV_SIZE 300 |
Size of a UGV in hangar capacity
Definition at line 33 of file cp_produce.h.
Referenced by BS_Buy_f(), BS_BuyUGV(), CAP_UpdateStorageCap(), E_HireEmployee(), E_MoveIntoNewBase(), and Employee::unhire().
| enum productionType_t |
| Enumerator | |
|---|---|
| PRODUCTION_TYPE_ITEM | |
| PRODUCTION_TYPE_AIRCRAFT | |
| PRODUCTION_TYPE_DISASSEMBLY | |
| PRODUCTION_TYPE_MAX | |
Definition at line 35 of file cp_produce.h.
| int PR_DecreaseProduction | ( | production_t * | prod, |
| int | amount ) |
decreases production amount
| [in,out] | prod | Pointer to the production |
| [in] | amount | Additional amount to remove (positive number) |
Definition at line 523 of file cp_produce.cpp.
References production_t::amount, cgi, production_t::data, ERR_DROP, production_t::idx, PR_GetProductionForBase, PR_GetTech(), PR_IsDisassembly, PR_ProductionBase(), PR_QueueDelete(), PR_UpdateRequiredItemsInBasestorage(), and technology_t::requireForProduction.
Referenced by PR_ProductionDecrease_f().
| const char * PR_GetName | ( | const productionData_t * | data | ) |
Definition at line 182 of file cp_produce.cpp.
References _, cgi, data, ERR_DROP, PRODUCTION_TYPE_AIRCRAFT, PRODUCTION_TYPE_DISASSEMBLY, PRODUCTION_TYPE_ITEM, and UFO_TypeToName().
Referenced by PR_FinishProduction(), PR_ProductionIncrease_f(), and PR_ShowActiveProduction_f().
Used in production costs (to allow reducing prices below 1x).
| [in] | productionCost | production cost being modified |
Definition at line 667 of file cp_produce.cpp.
References ccs.
Referenced by PR_AircraftInfo(), PR_CheckFrame(), PR_FinishProduction(), and PR_ItemProductionInfo().
| int PR_GetProductionHours | ( | const struct base_s * | base, |
| const productionData_t * | prodData ) |
| int PR_GetRemainingHours | ( | const production_t * | prod | ) |
Calculates the remaining hours for a technology.
| [in] | prod | Pointer to the production structure |
Definition at line 90 of file cp_produce.cpp.
References DateTime::MINUTES_PER_HOUR, and PR_GetRemainingMinutes().
Referenced by PR_ProductionInfo(), TEST_F(), TEST_F(), and TEST_F().
| int PR_GetRemainingMinutes | ( | const production_t * | prod | ) |
Calculates the remaining time for a technology in minutes.
| [in] | prod | Pointer to the production structure |
Definition at line 79 of file cp_produce.cpp.
References production_t::frame, PR_ProductionBase(), PR_WorkersAvailable(), and production_t::totalFrames.
Referenced by PR_GetRemainingHours(), TEST_F(), TEST_F(), and TEST_F().
| technology_t * PR_GetTech | ( | const productionData_t * | data | ) |
Definition at line 199 of file cp_produce.cpp.
References data, PRODUCTION_TYPE_AIRCRAFT, PRODUCTION_TYPE_DISASSEMBLY, PRODUCTION_TYPE_ITEM, and RS_GetTechForItem().
Referenced by PR_CalculateTotalFrames(), PR_DecreaseProduction(), PR_FinishProduction(), PR_IncreaseProduction(), PR_ProductionIncrease_f(), PR_ProductionListRightClick_f(), PR_QueueDelete(), and PR_QueueNew().
| int PR_IncreaseProduction | ( | production_t * | prod, |
| int | amount ) |
increases production amount if possible
| [in,out] | prod | Pointer to the production |
| [in] | amount | Additional amount to add |
Definition at line 490 of file cp_produce.cpp.
References production_t::amount, production_t::data, MAX_PRODUCTION_AMOUNT, PR_GetTech(), PR_IsDisassembly, PR_ProductionBase(), PR_RequirementsMet(), PR_UpdateRequiredItemsInBasestorage(), and technology_t::requireForProduction.
Referenced by PR_ProductionIncrease_f().
| bool PR_ItemIsProduceable | ( | const objDef_t * | item | ) |
check if an item is producable.
| [in] | item | Pointer to the item that should be checked. |
Definition at line 640 of file cp_produce.cpp.
References technology_t::produceTime, and RS_GetTechForItem().
Referenced by CP_ItemsSanityCheck(), PR_ItemProductionInfo(), PR_ProductionListClick_f(), and PR_UpdateProductionList().
| struct base_s * PR_ProductionBase | ( | const production_t * | production | ) |
Returns the base pointer the production belongs to.
| [in] | production | pointer to the production entry |
Definition at line 651 of file cp_produce.cpp.
References B_GetNext(), MAX_PRODUCTIONS, and PR_GetProductionForBase.
Referenced by PR_DecreaseProduction(), PR_GetRemainingMinutes(), PR_IncreaseProduction(), and US_RemoveStoredUFO().
Checks whether an item is finished.
Definition at line 556 of file cp_produce.cpp.
References B_GetNext(), production_t::frame, production_queue_t::items, production_queue_t::numItems, PR_CheckFrame(), PR_FinishDisassembly(), PR_FinishProduction(), PR_GetProductionForBase, PR_IsDisassembly, PR_IsProduction, PR_IsReady, PR_ProductionAllowed(), and PR_WorkersAvailable().
Referenced by CP_CampaignRun(), TEST_F(), TEST_F(), and TEST_F().
| void PR_QueueDelete | ( | struct base_s * | base, |
| production_queue_t * | queue, | ||
| int | index ) |
References index.
| void PR_QueueMove | ( | production_queue_t * | queue, |
| int | index, | ||
| int | offset ) |
Moves the given queue item in the given direction.
| [in] | queue | Pointer to the queue. |
| [in] | index | The production item index in the queue |
| [in] | offset | The offset relative to the given index where the item should be moved, too |
Definition at line 308 of file cp_produce.cpp.
References i, production_t::idx, index, production_queue_t::items, production_queue_t::numItems, and PR_SetUFODisassembly().
Referenced by PR_ProductionDown_f(), PR_ProductionRollBottom(), and PR_ProductionUp_f().
| production_t * PR_QueueNew | ( | struct base_s * | base, |
| const productionData_t * | data, | ||
| signed int | amount ) |
| void PR_QueueNext | ( | struct base_s * | base | ) |
| int PR_RequirementsMet | ( | int | amount, |
| const requirements_t * | reqs, | ||
| struct base_s * | base ) |
| void PR_UpdateRequiredItemsInBasestorage | ( | struct base_s * | base, |
| int | amount, | ||
| const requirements_t * | reqs ) |
| int PR_WorkersAvailable | ( | const struct base_s * | base | ) |