UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cp_market.h
Go to the documentation of this file.
1 
6 /*
7 Copyright (C) 2002-2020 UFO: Alien Invasion.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 */
24 
25 #pragma once
26 
28 typedef struct market_s {
38 } market_t;
39 
40 bool BS_AircraftIsOnMarket(const aircraft_t* aircraft);
41 int BS_GetAircraftOnMarket(const aircraft_t* aircraft);
42 int BS_GetAircraftSellingPrice(const aircraft_t* aircraft);
43 int BS_GetAircraftBuyingPrice(const aircraft_t* aircraft);
44 bool BS_BuyAircraft(const aircraft_t* aircraftTemplate, base_t* base);
45 bool BS_SellAircraft(aircraft_t* aircraft);
46 
47 bool BS_IsOnMarket(const objDef_t* item);
48 int BS_GetItemOnMarket(const objDef_t* od);
49 void BS_AddItemToMarket(const objDef_t* od, int amount);
50 int BS_GetItemSellingPrice(const objDef_t* od);
51 int BS_GetItemBuyingPrice(const objDef_t* od);
52 bool BS_BuyItem(const objDef_t* od, base_t* base, int count);
53 bool BS_SellItem(const objDef_t* od, base_t* base, int count);
54 
55 bool BS_BuyUGV(const ugv_t* ugv, base_t* base);
56 bool BS_SellUGV(Employee* robot);
57 
58 void BS_InitMarket(const struct campaign_s* campaign);
59 void CP_CampaignRunMarket(struct campaign_s* campaign);
int BS_GetItemSellingPrice(const objDef_t *od)
Get the price for an item that you want to sell on the market.
Definition: cp_market.cpp:89
bool BS_BuyItem(const objDef_t *od, base_t *base, int count)
Buys items from the market.
Definition: cp_market.cpp:381
int askAircraft[AIRCRAFTTYPE_MAX]
Definition: cp_market.h:36
void BS_AddItemToMarket(const objDef_t *od, int amount)
Internal function to add items to the market.
Definition: cp_market.cpp:63
int bidAircraft[AIRCRAFTTYPE_MAX]
Definition: cp_market.h:35
double currentEvolutionAircraft[AIRCRAFTTYPE_MAX]
Definition: cp_market.h:37
Defines a type of UGV/Robot.
Definition: chr_shared.h:234
bool BS_BuyUGV(const ugv_t *ugv, base_t *base)
Buys the given UGV.
Definition: cp_market.cpp:307
struct market_s market_t
Defines all attributes of objects used in the inventory.
Definition: inv_shared.h:264
A base with all it's data.
Definition: cp_base.h:84
bool BS_IsOnMarket(const objDef_t *item)
Check if an item is on market.
Definition: cp_market.cpp:41
int BS_GetAircraftSellingPrice(const aircraft_t *aircraft)
Get the price for an aircraft that you want to sell on the market.
Definition: cp_market.cpp:169
#define MAX_OBJDEFS
Definition: inv_shared.h:37
#define AIRCRAFTTYPE_MAX
Definition: inv_shared.h:34
bool BS_AircraftIsOnMarket(const aircraft_t *aircraft)
Checks whether a given aircraft should appear on the market.
Definition: cp_market.cpp:111
QGL_EXTERN GLuint count
Definition: r_gl.h:99
int BS_GetItemOnMarket(const objDef_t *od)
Get the number of items of the given type on the market.
Definition: cp_market.cpp:52
int BS_GetAircraftBuyingPrice(const aircraft_t *aircraft)
Get the price for an aircraft that you want to buy on the market.
Definition: cp_market.cpp:210
int BS_GetAircraftOnMarket(const aircraft_t *aircraft)
Get the number of aircraft of the given type on the market.
Definition: cp_market.cpp:126
int numItems[MAX_OBJDEFS]
Definition: cp_market.h:29
void CP_CampaignRunMarket(struct campaign_s *campaign)
make number of items change every day.
Definition: cp_market.cpp:578
int numAircraft[AIRCRAFTTYPE_MAX]
Definition: cp_market.h:34
int bidItems[MAX_OBJDEFS]
Definition: cp_market.h:30
int BS_GetItemBuyingPrice(const objDef_t *od)
Get the price for an item that you want to buy on the market.
Definition: cp_market.cpp:100
bool autosell[MAX_OBJDEFS]
Definition: cp_market.h:33
int askItems[MAX_OBJDEFS]
Definition: cp_market.h:31
An aircraft with all it's data.
Definition: cp_aircraft.h:114
bool BS_SellUGV(Employee *robot)
Sells the given UGV with all the equipment.
Definition: cp_market.cpp:343
double currentEvolutionItems[MAX_OBJDEFS]
Definition: cp_market.h:32
void BS_InitMarket(const struct campaign_s *campaign)
bool BS_SellItem(const objDef_t *od, base_t *base, int count)
Sells items from the market.
Definition: cp_market.cpp:413
bool BS_BuyAircraft(const aircraft_t *aircraftTemplate, base_t *base)
Buys an aircraft.
Definition: cp_market.cpp:236
bool BS_SellAircraft(aircraft_t *aircraft)
Sells the given aircraft with all the equipment.
Definition: cp_market.cpp:264