$treeview $search $mathjax
Stratagus
2.2.7
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include "map.h"
#include "pathfinder.h"
#include "unit.h"
#include "unittype.h"
Go to the source code of this file.
Classes | |
class | HasSameTypeAs |
class | HasSamePlayerAs |
class | HasNotSamePlayerAs |
class | IsAlliedWith |
class | IsEnemyWith |
class | HasSamePlayerAndTypeAs |
class | IsNotTheSameUnitAs |
class | IsBuildingType |
class | NotPredicate< Pred > |
class | AndPredicate< Pred1, Pred2 > |
class | CUnitTypeFinder |
class | UnitFinder |
Functions | |
unit.h - The unit headerfile. | |
template<typename Pred> | |
NotPredicate< Pred > | MakeNotPredicate (Pred pred) |
template<typename Pred1, typename Pred2> | |
AndPredicate< Pred1, Pred2 > | MakeAndPredicate (Pred1 pred1, Pred2 pred2) |
void | Select (const Vec2i <Pos, const Vec2i &rbPos, std::vector< CUnit * > &units) |
void | SelectFixed (const Vec2i <Pos, const Vec2i &rbPos, std::vector< CUnit * > &units) |
void | SelectAroundUnit (const CUnit &unit, int range, std::vector< CUnit * > &around) |
template<typename Pred> | |
void | SelectFixed (const Vec2i <Pos, const Vec2i &rbPos, std::vector< CUnit * > &units, Pred pred) |
template<typename Pred> | |
void | SelectAroundUnit (const CUnit &unit, int range, std::vector< CUnit * > &around, Pred pred) |
template<typename Pred> | |
void | Select (const Vec2i <Pos, const Vec2i &rbPos, std::vector< CUnit * > &units, Pred pred) |
template<typename Pred> | |
CUnit * | FindUnit_IfFixed (const Vec2i <Pos, const Vec2i &rbPos, Pred pred) |
template<typename Pred> | |
CUnit * | FindUnit_If (const Vec2i <Pos, const Vec2i &rbPos, Pred pred) |
CUnit * | UnitFindResource (const CUnit &unit, const CUnit &startUnit, int range, int resource, bool check_usage=false, const CUnit *deposit=NULL) |
Find resource. | |
CUnit * | FindDeposit (const CUnit &unit, int range, int resource) |
Find nearest deposit. | |
CUnit * | FindIdleWorker (const CPlayer &player, const CUnit *last) |
Find the next idle worker. | |
bool | FindTerrainType (int movemask, int resmask, int range, const CPlayer &player, const Vec2i &startPos, Vec2i *pos) |
Find the neareast piece of terrain with specific flags. | |
void | FindUnitsByType (const CUnitType &type, std::vector< CUnit * > &units) |
void | FindPlayerUnitsByType (const CPlayer &player, const CUnitType &type, std::vector< CUnit * > &units) |
Find all units of this type of the player. | |
CUnit * | UnitOnMapTile (const Vec2i &pos, unsigned int type) |
Return any unit on that map tile. | |
CUnit * | TargetOnMap (const CUnit &unit, const Vec2i &pos1, const Vec2i &pos2) |
Return possible attack target on that map area. | |
CUnit * | ResourceOnMap (const Vec2i &pos, int resource, bool mine_on_top=true) |
Return resource, if on map tile. | |
CUnit * | ResourceDepositOnMap (const Vec2i &pos, int resource) |
Return resource deposit, if on map tile. | |
CUnit * | AttackUnitsInDistance (const CUnit &unit, int range, bool onlyBuildings=false) |
Find best enemy in numeric range to attack. | |
CUnit * | AttackUnitsInRange (const CUnit &unit) |
Find best enemy in attack range to attack. | |
CUnit * | AttackUnitsInReactRange (const CUnit &unit) |
Find best enemy in reaction range to attack. |
Find best enemy in numeric range to attack.
Attack units in distance.
If the unit can attack must be handled by caller. Choose the best target, that can be attacked.
unit | Find in distance for this unit. | |
range | Distance range to look. | |
onlyBuildings | Search only buildings (useful when attacking with AI force) |
Find best enemy in attack range to attack.
Attack units in attack range.
unit | Find unit in attack range for this unit. |
Find best enemy in reaction range to attack.
Attack units in reaction range.
unit | Find unit in reaction range for this unit. |
Find nearest deposit.
Find deposit. This will find a deposit for a resource
unit | The unit that wants to find a resource. | |
x | Closest to x | |
y | Closest to y | |
range | Maximum distance to the deposit. | |
resource | Resource to find deposit from. |
Find the next idle worker.
Find the next idle worker
player | Player's units to search through | |
last | Previous idle worker selected |
void FindPlayerUnitsByType | ( | const CPlayer & | player, | |
const CUnitType & | type, | |||
std::vector< CUnit * > & | table | |||
) |
Find all units of this type of the player.
Find all units of type.
player | we're looking for the units of this player | |
type | type of unit requested | |
table | table in which we have to store the units |
bool FindTerrainType | ( | int | movemask, | |
int | resmask, | |||
int | range, | |||
const CPlayer & | player, | |||
const Vec2i & | startPos, | |||
Vec2i * | pos | |||
) |
Find the neareast piece of terrain with specific flags.
CUnit* FindUnit_If | ( | const Vec2i & | ltPos, | |
const Vec2i & | rbPos, | |||
Pred | pred | |||
) | [inline] |
CUnit* FindUnit_IfFixed | ( | const Vec2i & | ltPos, | |
const Vec2i & | rbPos, | |||
Pred | pred | |||
) | [inline] |
Find all units of type.
type | type of unit requested | |
units | array in which we have to store the units |
AndPredicate<Pred1, Pred2> MakeAndPredicate | ( | Pred1 | pred1, | |
Pred2 | pred2 | |||
) | [inline] |
NotPredicate<Pred> MakeNotPredicate | ( | Pred | pred | ) | [inline] |
Return resource deposit, if on map tile.
Return resource, if on map tile.
void Select | ( | const Vec2i & | ltPos, | |
const Vec2i & | rbPos, | |||
std::vector< CUnit * > & | units, | |||
Pred | pred | |||
) | [inline] |
void SelectAroundUnit | ( | const CUnit & | unit, | |
int | range, | |||
std::vector< CUnit * > & | around, | |||
Pred | pred | |||
) | [inline] |
void SelectFixed | ( | const Vec2i & | ltPos, | |
const Vec2i & | rbPos, | |||
std::vector< CUnit * > & | units, | |||
Pred | pred | |||
) | [inline] |
Return possible attack target on that map area.
CUnit* UnitFindResource | ( | const CUnit & | unit, | |
const CUnit & | startUnit, | |||
int | range, | |||
int | resource, | |||
bool | check_usage, | |||
const CUnit * | deposit | |||
) |
Find resource.
Find Resource.
unit | The unit that wants to find a resource. | |
startUnit | Find closest unit from this location | |
range | Maximum distance to the resource. | |
resource | The resource id. |