cp_produce.h
Go to the documentation of this file.00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef CLIENT_CP_PRODUCE
00027 #define CLIENT_CP_PRODUCE
00028
00030 #define MAX_PRODUCTIONS 256
00031 #define MAX_PRODUCTIONS_PER_WORKSHOP 5
00032
00033 #define MAX_PRODUCTION_AMOUNT 500
00034
00036 #define UGV_SIZE 300
00037
00038 extern const int PRODUCE_FACTOR;
00039 extern const int PRODUCE_DIVISOR;
00040
00048 typedef struct production_s
00049 {
00050 int idx;
00055 objDef_t *item;
00056 struct aircraft_s *aircraft;
00057 struct storedUFO_s *ufo;
00058
00059 signed int amount;
00060 float percentDone;
00062 qboolean spaceMessage;
00063 qboolean creditMessage;
00065 qboolean production;
00066 } production_t;
00067
00072 typedef struct production_queue_s
00073 {
00074 int numItems;
00075 production_t items[MAX_PRODUCTIONS];
00076 } production_queue_t;
00077
00078 void PR_ProductionInit(void);
00079 void PR_ProductionRun(void);
00080
00081 qboolean PR_ItemIsProduceable(const objDef_t const *item);
00082
00083 base_t *PR_ProductionBase(production_t *production);
00084 base_t *PR_ProductionQueueBase (const production_queue_t const *queue);
00085
00086 int PR_IncreaseProduction(production_t *prod, int amount);
00087 int PR_DecreaseProduction(production_t *prod, int amount);
00088
00089 void PR_UpdateProductionCap(struct base_s *base);
00090
00091 void PR_UpdateRequiredItemsInBasestorage(base_t *base, int amount, const requirements_t const *reqs);
00092 int PR_RequirementsMet(int amount, const requirements_t const *reqs, base_t *base);
00093
00094 float PR_CalculateProductionPercentDone(const base_t *base, const technology_t *tech, const struct storedUFO_s *const storedUFO);
00095
00096 production_t *PR_QueueNew(base_t *base, production_queue_t *queue, objDef_t *item, aircraft_t *aircraftTemplate, struct storedUFO_s *ufo, signed int amount);
00097 void PR_QueueMove(production_queue_t *queue, int index, int dir);
00098 void PR_QueueDelete(base_t *base, production_queue_t *queue, int index);
00099 void PR_QueueNext(base_t *base);
00100 int PR_QueueFreeSpace(const production_queue_t const *queue);
00101
00102 #endif
00103