forked from Ares-Developers/YRpp
-
Notifications
You must be signed in to change notification settings - Fork 25
/
AircraftTrackerClass.h
42 lines (29 loc) · 1.17 KB
/
AircraftTrackerClass.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
41
42
#pragma once
#include <Helpers/CompileTime.h>
#include <CellClass.h>
#include <GeneralStructures.h>
#include <ArrayClasses.h>
class TechnoClass;
// Tracks aerial units via 20x20 vectors spread across the maps for efficient search
class AircraftTrackerClass
{
public:
static constexpr reference<AircraftTrackerClass, 0x887888u> Instance { };
// Fills CurrentVector with items from TrackerVectors matching given range around cell.
void FillCurrentVector(CellClass* pCell, int range) { JMP_THIS(0x412B40) }
// Gets items from CurrentVector.
TechnoClass* Get() { JMP_THIS(0x4137A0) }
void Add(TechnoClass* entry) { JMP_THIS(0x4134A0) }
void Update(TechnoClass* entry, CellStruct oldPos, CellStruct newPos) { JMP_THIS(0x4138C0) }
void Remove(TechnoClass* entry) { JMP_THIS(0x4135D0) }
bool Clear() { JMP_THIS(0x413800) }
bool IsJumpjet(TechnoClass* entry) { JMP_THIS(0x4135A0) }
int GetVectorIndex(CellStruct pos) { JMP_THIS(0x412AC0) }
// TODO write other entries
private:
AircraftTrackerClass() {}
public:
DynamicVectorClass<TechnoClass*> TrackerVectors[20][20];
DynamicVectorClass<TechnoClass*> CurrentVector;
};
static_assert(sizeof(AircraftTrackerClass) == 0x2598);