$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 <limits.h>
#include "stratagus.h"
#include "unit_find.h"
#include "actions.h"
#include "map.h"
#include "missile.h"
#include "pathfinder.h"
#include "player.h"
#include "spells.h"
#include "unit.h"
#include "unit_manager.h"
#include "unittype.h"
Classes | |
class | NoFilter |
class | TerrainFinder |
class | BestDepotFinder< NEARLOCATION > |
class | CResourceFinder |
class | ResourceUnitFinder |
struct | ResourceUnitFinder::ResourceUnitFinder_Cost |
class | IsADepositForResource |
class | BestTargetFinder |
class | BestRangeTargetFinder |
class | BestRangeTargetFinder::FillBadGood |
struct | CompareUnitDistance |
Functions | |
unit_find.cpp - The find/select for units. | |
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) |
bool | FindTerrainType (int movemask, int resmask, int range, const CPlayer &player, const Vec2i &startPos, Vec2i *terrainPos) |
CUnit * | FindDepositNearLoc (CPlayer &p, const Vec2i &pos, int range, int resource) |
CUnit * | UnitFindResource (const CUnit &unit, const CUnit &startUnit, int range, int resource, bool check_usage, const CUnit *deposit) |
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. | |
void | FindUnitsByType (const CUnitType &type, std::vector< CUnit * > &units) |
void | FindPlayerUnitsByType (const CPlayer &player, const CUnitType &type, std::vector< CUnit * > &table) |
Find all units of this type of the player. | |
CUnit * | UnitOnMapTile (const unsigned int index, unsigned int type) |
CUnit * | UnitOnMapTile (const Vec2i &pos, unsigned int type) |
CUnit * | TargetOnMap (const CUnit &source, const Vec2i &pos1, const Vec2i &pos2) |
CUnit * | ResourceOnMap (const Vec2i &pos, int resource, bool mine_on_top) |
CUnit * | ResourceDepositOnMap (const Vec2i &pos, int resource) |
CUnit * | AttackUnitsInDistance (const CUnit &unit, int range, bool onlyBuildings) |
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 * | terrainPos | |||
) |
Find the closest piece of terrain with the given flags.
movemask | The movement mask to reach that location. | |
resmask | Result tile mask. | |
range | Maximum distance for the search. | |
player | Only search fields explored by player | |
startPos | Map start position for the search. | |
terrainPos | OUT: Map position of tile. |
Find all units of type.
type | type of unit requested | |
units | array in which we have to store the units |
Resource deposit on map tile
pos | position on map, tile-based. | |
resource | resource type. |
Resource on map tile
pos | position on map, tile-based. | |
resource | resource type. | |
mine_on_top | return mine or mining area. |
Choose target on map area.
source | Unit which want to attack. | |
pos1 | position on map, tile-based. | |
pos2 | position on map, tile-based. |
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. |
Unit on map tile.
pos | position on map, tile-based. | |
type | UnitTypeType, (unsigned)-1 for any type. |
CUnit* UnitOnMapTile | ( | const unsigned int | index, | |
unsigned int | type | |||
) |
Unit on map tile.
index | flat index position on map, tile-based. | |
type | UnitTypeType, (unsigned)-1 for any type. |