-
Notifications
You must be signed in to change notification settings - Fork 0
/
VehicleCounter.h
40 lines (33 loc) · 1012 Bytes
/
VehicleCounter.h
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
#pragma once
#include "OP2Helper/ColonyType.h"
#include "Outpost2DLL/Outpost2DLL.h"
#include <vector>
//Note: Currently only PlayerBuildingEnum returns buildings, so part of this class will not work properly :(.
namespace UnitHelper
{
struct UnitCount
{
map_id UnitType;
map_id UnitCargo;
int Count;
};
class VehicleCounter
{
public:
int GetVehicleCount()
{
return VehicleCount;
}
int GetVehicleCount(map_id vehicleType);
int GetVehicleCount(map_id vehicleType, map_id cargoType);
void PullVehiclesFromRectangle(PlayerNum playerNum, InRectEnumerator inRectEnumerator);
void PullVehiclesFromPlayer(PlayerUnitEnum playerUnitEnum);
void Clear();
private:
int VehicleCount = 0;
std::vector<UnitCount> VehicleCountVector;
void AddVehicleToVector(map_id vehicleType, map_id cargoType);
void GetVehicleIndices(std::vector<int>& VehicleIndices, map_id vehicleType);
int GetVehicleIndex(map_id vehicleType, map_id cargoType);
};
}