-
Notifications
You must be signed in to change notification settings - Fork 3
/
Placement.h
33 lines (29 loc) · 1.53 KB
/
Placement.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
#pragma once
#include "MapTopology.h"
class BuildingPlacer {
std::vector<int> reserved;
int width;
int height;
const MapTopology * map;
public :
void init(const sc2::ObservationInterface * initial, sc2::QueryInterface * query, const MapTopology * map, sc2::DebugInterface * debug = nullptr);
// query build grid at given point
bool Placement(const sc2::GameInfo & info, const sc2::Point2D & point) const;
bool PlacementI(const sc2::GameInfo & info, const sc2::Point2DI & pointI) const;
bool PlacementB(const sc2::GameInfo & info, const sc2::Point2D & point, int footprint) const;
// higher level API : find a list of locations for a building, at or around a given location
// specify additional constraints to sort the result
std::vector<sc2::Point2D> Placements(const sc2::GameInfo & info, const sc2::Point2D & center, int footprint, int maxdistance) const;
// updating the grid
// add (b=true) or remove (b=false) a building of footprint size, at given position (center of the unit/unit pos)
bool setBuildingAt(sc2::GameInfo & info, const sc2::Point2D & pos, int foot, bool b);
// reserve some tile
void reserve(const sc2::Point2D & point);
// reserve mineral/gas tiles for an expansion index
void reserve(int expIndex);
void reserveVector(const sc2::Point2D & start, const sc2::Point2D & vec);
void reserveCliffSensitive(int expIndex, const sc2::ObservationInterface* obs, const sc2::GameInfo & info);
#ifdef DEBUG
void debug(sc2::DebugInterface * debug, const sc2::ObservationInterface * obs, const sc2::GameInfo & info);
#endif // DEBUG
};