kora-bot/Source/Util.h

42 lines
1.5 KiB
C
Raw Normal View History

2023-04-10 23:31:02 +00:00
#pragma once
#include <BWAPI.h>
#include "CBase.h"
#include "CUnit.h"
#include "Macro.h"
#include "CMap.h"
using namespace BWAPI;
class CBase;
class CUnit;
class Util
{
public:
static int buildWorkerIndex();
static bool completedBuilding(BWAPI::UnitType unitType);
static int countUnits(int playerID, BWAPI::UnitType unitType);
static void displayQueue();
2023-04-10 23:31:02 +00:00
static int eggCount(BWAPI::UnitType unitType);
static int findUpgradeBuilding(BWAPI::UpgradeType upgradeType);
static int getBaseIndex(Unit unit);
static int getClosestOwnedBase(Unit unit);
static double getDistance(TilePosition tp1, TilePosition tp2);
static int getLocation(TilePosition tp);
static std::pair<const BWEM::Area*, bool> getNeighborArea(const BWEM::Area* a1, const BWEM::Area* a2);
static CBase getNextExpand(int playerID);
static int getQueueIndex(UnitType ut);
static int getStaticDCount(int playerID, std::string type);
2023-04-10 23:31:02 +00:00
static std::pair<const BWEM::Area*, bool> getTargetArea(const BWEM::Area* startingArea, bool startLocation);
static int getUnitIndex(Unit unit);
static double getWalkDistance(TilePosition tp1, TilePosition tp2);
static bool isAttackingUnit(CUnit u);
static bool isBase(Unit unit);
2023-04-10 23:31:02 +00:00
static bool isBasePosition(TilePosition tp);
static bool isSameArea(const BWEM::Area* area1, const BWEM::Area* area2);
static bool isSameTilePosition(TilePosition tp1, TilePosition tp2);
2023-04-10 23:31:02 +00:00
static int ownedBy(TilePosition tp);
static bool unitCounted(Unit unit);
static int workerBuildingTargetCount(UnitType unit);
};