UFO: Alien Invasion
Loading...
Searching...
No Matches
AiAreaSearch Class Reference

AiAreaSearch class, used to get an area of the map around a certain position for the AI to check possible moving positions. More...

#include <g_ai.h>

Collaboration diagram for AiAreaSearch:
Collaboration graph

Data Structures

class  LQueue
 A simple queue class. More...

Public Member Functions

 AiAreaSearch ()
 Initializes an AiAreaSearch object to default values.
 AiAreaSearch (const pos3_t origin, int radius, bool flat=false)
 Initializes an AiAreaSearch object with specific starting point and search radius.
 ~AiAreaSearch (void)
 Clear AiAreaSearch internal data.
bool getNext (pos3_t pos)
 Get next position in the search area.

Private Member Functions

void plotArea (const pos3_t origin, int radius, bool flat=false)
 Calculate the search area.
void plotCircle (const pos3_t origin, int radius)
void plotPos (const pos3_t origin, int xOfs, int yOfs)

Private Attributes

LQueue _area

Detailed Description

AiAreaSearch class, used to get an area of the map around a certain position for the AI to check possible moving positions.

Definition at line 33 of file g_ai.h.

Constructor & Destructor Documentation

◆ AiAreaSearch() [1/2]

AiAreaSearch::AiAreaSearch ( void )

Initializes an AiAreaSearch object to default values.

Definition at line 56 of file g_ai.cpp.

References plotArea(), and pos3_origin.

◆ AiAreaSearch() [2/2]

AiAreaSearch::AiAreaSearch ( const pos3_t origin,
int radius,
bool flat = false )

Initializes an AiAreaSearch object with specific starting point and search radius.

Definition at line 63 of file g_ai.cpp.

References plotArea().

◆ ~AiAreaSearch()

AiAreaSearch::~AiAreaSearch ( void )

Clear AiAreaSearch internal data.

Definition at line 70 of file g_ai.cpp.

References _area.

Member Function Documentation

◆ getNext()

bool AiAreaSearch::getNext ( pos3_t pos)

Get next position in the search area.

Parameters
[out]posThe next position in the search area. return true if a new position was found false otherwise.

Definition at line 79 of file g_ai.cpp.

References _area.

Referenced by AI_FindHerdLocation(), AI_FindHidingLocation(), AI_FindMissionLocation(), AI_PrepBestAction(), AIL_positionflee(), AIL_positionshoot(), and AIL_positionwander().

◆ plotArea()

void AiAreaSearch::plotArea ( const pos3_t origin,
int radius,
bool flat = false )
private

Calculate the search area.

Parameters
[in]originThe starting position for the search.
[in]radiusRadius to search around the starting position.
[in]flatIf true only the level with the starting position is searched.

Definition at line 143 of file g_ai.cpp.

References i, PATHFINDING_HEIGHT, and plotCircle().

Referenced by AiAreaSearch(), and AiAreaSearch().

◆ plotCircle()

void AiAreaSearch::plotCircle ( const pos3_t origin,
int radius )
private

Definition at line 165 of file g_ai.cpp.

References PATHFINDING_HEIGHT, and plotPos().

Referenced by plotArea().

◆ plotPos()

void AiAreaSearch::plotPos ( const pos3_t origin,
int xOfs,
int yOfs )
private

Definition at line 203 of file g_ai.cpp.

References _area, gi, PATHFINDING_WIDTH, and PosToVec.

Referenced by plotCircle().

Field Documentation

◆ _area

LQueue AiAreaSearch::_area
private

Queue containing the positions in the search area

Definition at line 70 of file g_ai.h.

Referenced by getNext(), plotPos(), and ~AiAreaSearch().


The documentation for this class was generated from the following files: