$treeview $search $mathjax
Stratagus
2.2.6
$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 <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include "stratagus.h"
#include "map.h"
#include "video.h"
#include "sound.h"
#include "unitsound.h"
#include "unittype.h"
#include "actions.h"
#include "player.h"
#include "missile.h"
#include "unit.h"
#include "interface.h"
#include "tileset.h"
#include "pathfinder.h"
Classes | |
struct | BestTargetFinder |
struct | BestRangeTargetFinder |
struct | BestRangeTargetFinder::FillBadGood |
struct | CompareUnitDistance |
unit_find.cpp - The find/select for units. | |
#define | PRIORITY_FACTOR 0x00010000 |
#define | HEALTH_FACTOR 0x00000001 |
#define | DISTANCE_FACTOR 0x00100000 |
#define | INRANGE_FACTOR 0x00010000 |
#define | INRANGE_BONUS 0x01000000 |
#define | CANATTACK_BONUS 0x00100000 |
int | FindUnitsByType (const CUnitType &type, CUnit **table) |
Find all units of this type. | |
int | FindPlayerUnitsByType (const CPlayer &player, const CUnitType &type, 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, int x1, int y1, int x2, int y2) |
Return possible attack target on that map area. | |
CUnit * | ResourceOnMap (const Vec2i &pos, int resource, bool mine_on_top) |
CUnit * | ResourceDepositOnMap (const Vec2i &pos, int resource) |
CUnit * | AutoAttackUnitsInDistance (const CUnit &unit, int range, CUnitCache &autotargets) |
CUnit * | AttackUnitsInDistance (const CUnit &unit, int range) |
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. |
#define CANATTACK_BONUS 0x00100000 |
#define DISTANCE_FACTOR 0x00100000 |
#define HEALTH_FACTOR 0x00000001 |
#define INRANGE_BONUS 0x01000000 |
#define INRANGE_FACTOR 0x00010000 |
#define PRIORITY_FACTOR 0x00010000 |
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. |
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. |
CUnit* AutoAttackUnitsInDistance | ( | const CUnit & | unit, | |
int | range, | |||
CUnitCache & | autotargets | |||
) |
AutoAttack 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. | |
autotargets | Know enemy targets to chose in range. |
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 |
Find all units of this type.
Find all units of type.
type | type of unit requested | |
table | table 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. |
Return possible attack target on that map area.
Choose target on map area.
source | Unit which want to attack. | |
x1 | X position on map, tile-based. | |
y1 | Y position on map, tile-based. | |
x2 | X position on map, tile-based. | |
y2 | Y position on map, tile-based. |
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. |