Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#include "Common.h"
#include "UnitType.h"
class IDABot;
class MetaType;
struct TypeData
{
CCRace race;
int mineralCost = 0; // mineral cost of the item
int gasCost = 0; // gas cost of the item
int supplyCost = 0; // supply cost of the item
int buildTime = 0; // build time of the item
bool isUnit = false;
bool isBuilding = false;
bool isWorker = false;
bool isRefinery = false;
bool isSupplyProvider= false;
bool isResourceDepot = false;
bool isAddon = false;
sc2::AbilityID buildAbility = 0; // the ability that creates this item
sc2::AbilityID warpAbility = 0; // the ability that creates this item via warp-in
std::vector<UnitType> whatBuilds; // any of these units can build the item
std::vector<UnitType> requiredUnits; // owning ONE of these is required to make
std::vector<CCUpgrade> requiredUpgrades; // having ALL of these is required to make
};
class TechTree
{
IDABot & m_bot;
std::map<UnitType, TypeData> m_unitTypeData;
std::map<CCUpgrade, TypeData> m_upgradeData;
void initUnitTypeData();
void initUpgradeData();
public:
TechTree(IDABot & bot);
void onStart();
const TypeData & getData(const UnitType & type) const;
const TypeData & getData(const CCUpgrade & type) const;
const TypeData & getData(const MetaType & type) const;
};