|
template<typename A , typename B > |
constexpr bool | isEqualButNotNoValue (A &&a, B &&b) |
|
template<typename A > |
constexpr bool | isEqualButNotNoValue (A &&a, NoValue) |
|
template<typename B > |
constexpr bool | isEqualButNotNoValue (NoValue, B &&b) |
|
template<typename Iterator , typename Score , typename InvalidScore = NoValue, typename BestPossibleScore = NoValue> |
auto | getBestScore (Iterator begin, Iterator end, Score &&score, InvalidScore &&invalidScore=InvalidScore(), BestPossibleScore &&bestPossibleScore=BestPossibleScore()) |
| This function iterates from begin to end, passing each value to the provided score function. More...
|
|
template<typename Range , typename Score , typename InvalidScore = NoValue, typename BestPossibleScore = NoValue> |
auto | getBestScore (Range &&range, Score &&score, InvalidScore &&invalidScore=InvalidScore(), BestPossibleScore &&bestPossibleScore=BestPossibleScore()) |
| This function is equivalent to getBestScore, but it can be passed a range or container instead of two iterators. More...
|
|
template<typename Range , typename Score , typename InvalidScore = NoValue, typename BestPossibleScore = NoValue> |
auto | getBestScoreCopy (Range &&range, Score &&score, InvalidScore &&invalidScore=InvalidScore(), BestPossibleScore &&bestPossibleScore=BestPossibleScore()) |
| This function is the same as getBestScore, but it returns a copy of the value retrieved by dereferencing the returned iterator (using auto type semantics; it's a copy, not a reference). More...
|
|
template<typename Range , typename Score , typename InvalidScore = NoValue, typename BestPossibleScore = NoValue> |
auto | getBestScorePointer (Range &&range, Score &&score, InvalidScore &&invalidScore=InvalidScore(), BestPossibleScore &&bestPossibleScore=BestPossibleScore()) |
| This function is the same as getBestScore, but it returns a pointer to the value of the dereferenced result iterator, or nullptr if the end iterator would be returned. More...
|
|
std::string | buildTypeString (BuildType const *buildType) |
|
template<typename Units > |
Position | centerOfUnits (Units &&units) |
|
template<typename InputIterator > |
Position | centerOfUnits (InputIterator start, InputIterator end) |
|
bool | isWithinRadius (Unit *unit, int32_t x, int32_t y, float radius) |
|
template<typename Units > |
std::vector< Unit * > | filterUnitsByDistance (Units &&units, int32_t x, int32_t y, float radius) |
|
template<typename It > |
It | getClosest (int x, int y, It first, It last) |
|
template<typename Units > |
std::unordered_set< Unit * > | findNearbyEnemyUnits (State *state, Units &&units) |
|
std::tuple< int, int, float > | argmax (torch::Tensor const &pos, int scale) |
|
template<typename T > |
void | inplace_flat_vector_add (std::vector< T > &in, const std::vector< T > &add) |
|
template<typename T > |
void | inplace_flat_vector_addcmul (std::vector< T > &in, const std::vector< T > &mul1, const std::vector< T > &mul2) |
|
template<typename T > |
void | inplace_flat_vector_addcmul (std::vector< T > &in, const std::vector< T > &mul1, T mul2) |
|
template<typename T > |
void | inplace_flat_vector_div (std::vector< T > &in, T div) |
|
template<typename T > |
T | l2_norm_vector (const std::vector< T > &v) |
|
template<typename T > |
size_t | argmax (const std::vector< T > &v) |
|
template<typename TCollection , typename TKey > |
bool | contains (TCollection &collection, TKey &key) |
|
template<typename T , typename... Args> |
std::remove_reference< T >::type | cmerge (T &&c1, Args &&...cs) |
| Merges two or more STL containers. More...
|
|
bool | isExecutingCommand (tc::Unit const &unit, tc::BW::UnitCommandType command) |
|
bool | isExecutingCommand (Unit const *unit, tc::BW::UnitCommandType command) |
|
UnitId | commandUnitId (tc::Client::Command const &cmd) |
|
tc::BW::UnitCommandType | commandUnitType (tc::Client::Command const &cmd) |
|
tc::BW::UnitType | buildCommandUnitType (tc::Client::Command const &cmd) |
|
tc::BW::UnitType | trainCommandUnitType (tc::Client::Command const &cmd) |
|
Position | buildCommandPosition (tc::Client::Command const &cmd) |
|
bool | tcOrderIsAttack (int orderId) |
|
std::string | commandString (State *state, tc::Client::Command const &cmd) |
|
void | spawnUnit (State *state, PlayerId team, BuildType const *typ, Position loc) |
|
void | spawnUnit (State *state, PlayerId team, int typ, Position loc) |
|
void | killUnit (State *state, Unit *u) |
|
std::map< std::string, std::string > | gflagsValues (std::string const &sourcePath=std::string()) |
| Retrieves current gflags values, optionally restricted to a source file. More...
|
|
std::string | curTimeString (char const *format) |
|
std::string | visualizeHeatmap (torch::Tensor inp) |
|
std::string | commandString (Command c) |
|
template<typename T > |
std::string | positionString (Vec2T< T > position) |
|
std::string | unitString (Unit const *unit) |
|
template<typename Units > |
std::string | unitsString (Units &&units) |
|
template<typename T > |
std::string | resourcesString (T &&resources) |
|
std::string | upcString (UpcId id) |
|
std::string | upcString (std::shared_ptr< UPCTuple > const &upc, UpcId id) |
|
std::string | upcTaskString (State *state, UpcId upcId) |
|
std::string | commandBwString (int commandType) |
|
void | drawLine (State *state, Position const &a, Position const &b, int color=255) |
|
void | drawLine (State *state, Unit const *a, Unit const *b, int color=255) |
|
void | drawLine (State *state, Unit const *a, Position const &b, int color=255) |
|
void | drawBox (State *state, Position const &a, Position const &b, int color=255) |
|
void | drawBox (State *state, Rect const &r, int color=255) |
|
void | drawCircle (State *state, Position const &a, int radius, int color=255) |
|
void | drawCircle (State *state, Unit const *u, int radius, int color=255) |
|
void | drawTextPx (State *state, Position const &a, const std::string &text) |
|
void | drawText (State *state, Position const &a, const std::string &text) |
|
void | drawTextCenteredLinesPx (State *state, Position const &a, const std::vector< std::string > &lines) |
|
void | drawTextCenteredPx (State *state, Position const &a, const std::string &text) |
|
void | drawTextScreen (State *state, int xCharacter, int yLine, const std::string &text) |
|
void | drawUnitCommand (State *state, Unit *unit, Command commandCpi, int commandBw, UpcId upcId) |
|
template<typename Units , typename UnaryPredicate > |
auto | filterUnits (Units &&units, UnaryPredicate pred) |
|
template<typename Units , typename UnaryPredicate > |
auto | countUnits (Units &&units, UnaryPredicate pred) |
|
std::vector< tc::Unit > | filterUnitsByType (std::vector< tc::Unit > const &units, tc::BW::UnitType type) |
|
std::vector< tc::Unit > | filterUnitsByTypes (std::vector< tc::Unit > const &units, std::vector< tc::BW::UnitType > const &types) |
|
std::vector< tc::Unit > | filterUnitsByType (std::vector< tc::Unit > const &units, std::function< bool(tc::BW::UnitType)> const &pred) |
|
unsigned int | disthelper (unsigned int dx, unsigned int dy) |
| Approximation of Euclidian distance This is the same approximation that StarCraft's engine uses and thus should be more accurate than true Euclidian distance. More...
|
|
unsigned int | pxdistance (int px1, int py1, int px2, int py2) |
| Pixel distance. More...
|
|
float | distance (int x1, int y1, int x2, int y2) |
| Walktile distance. More...
|
|
float | distance (Unit const *a, Unit const *b) |
| Walktile distance. More...
|
|
float | distance (Position const &a, Position const &b) |
| Walktile distance. More...
|
|
float | distance (Unit const *a, Position const &b) |
| Walktile distance. More...
|
|
float | distance (Position const &a, Unit const *b) |
| Walktile distance. More...
|
|
int | pxDistanceBB (int xminA, int yminA, int xmaxA, int ymaxA, int xminB, int yminB, int xmaxB, int ymaxB) |
| Distance between two bounding boxes, in pixels. More...
|
|
int | pxDistanceBB (Unit const *a, Unit const *b) |
|
float | distanceBB (Unit const *a, Unit const *b) |
|
template<typename T > |
float | distanceBB (Unit const *a, Vec2T< T > const &pa, Unit const *b, Vec2T< T > const &pb) |
|
Position | predictPosition (Unit const *unit, double frames) |
| Predict the position of a unit some frames into the future. More...
|
|
Position | getMovePosHelper (int ux, int uy, int px, int py, int mx, int my, double angle, bool exact) |
|
Position | getMovePos (const State *const state, const Unit *const u, Position p, double angle=0, bool exact=true) |
|
Position | getMovePos (const State *const state, const Unit *const u, const Unit *const p, double angle=0, bool exact=true) |
|
Position | clampPositionToMap (const State *const state, int const x, int const y, bool strict=false) |
|
Position | clampPositionToMap (const State *const state, Position const &pos, bool strict=false) |
|
bool | isWorker (tc::Unit const &unit) |
|
bool | isBuilding (tc::Unit const &unit) |
|
std::vector< tc::Unit > | getWorkers (tc::State *state) |
|
std::vector< tc::Unit > | getMineralFields (tc::State *state) |
|
bool | isBuildable (tc::State *state, int x, int y) |
|
bool | prerequisitesReady (State *state, const BuildType *buildType) |
|
void | updateInBaseArea (State *state, std::vector< uint8_t > &inBaseArea) |
|
auto | makeSharpUPC (Unit *u, Command c) |
|
auto | makeSharpUPC (Unit *u, Position p, Command c) |
|
auto | makeSharpUPC (Unit *u, Unit *p, Command c) |
|
auto | makeSharpUPC (Unit *u, Position p, Command c, BuildType const *ct) |
|
auto | makeSharpUPC (Unit *u, Unit *p, Command c, BuildType const *ct) |
|
auto | makeSharpUPC (UPCTuple &other_upc, Unit *u, Command c) |
|