C# Class ctac.MapService

Inheritance: IMapService
Mostra file Open project: dshook/centauri-tac Class Usage Examples

Private Properties

Property Type Description
CheckNeighbors Tile>.Dictionary
GetTilesInRadiusGeneric Tile>.Dictionary
ReconstructPath List
getValueOrMax int
heuristic_cost_estimate int

Public Methods

Method Description
Expand ( List selection, int distance ) : Tile>.Dictionary
FindPath ( Tile start, Tile end, int maxDist, int controllingPlayerId ) : List
GetCrossTiles ( Vector2 center, int distance ) : Tile>.Dictionary
GetDiagonalNeighbors ( Vector2 center ) : Tile>.Dictionary
GetDiagonalTilesInRadius ( Vector2 center, int distance ) : Tile>.Dictionary
GetKingNeighbors ( Vector2 center ) : Tile>.Dictionary
GetKingTilesInRadius ( Vector2 center, int distance ) : Tile>.Dictionary
GetLineTiles ( Vector2 center, Vector2 secondPoint, int distance, bool bothDirections ) : Tile>.Dictionary
GetMovableNeighbors ( Tile center, int controllingPlayerId, Tile dest = null ) : Tile>.Dictionary

Find neighboring tiles that aren't occupied by enemies, but always include the dest tile for attacking if it's passed but also make sure not to land on a tile with an occupant if attacking

GetMovementTilesInRadius ( Vector2 center, int distance, int controllingPlayerId ) : Tile>.Dictionary
GetNeighbors ( Vector2 center ) : Tile>.Dictionary
GetTilesInRadius ( Vector2 center, int distance ) : Tile>.Dictionary
KingDistance ( Vector2 a, Vector2 b ) : int
Tile ( Vector2 position ) : Tile
TileDistance ( Vector2 a, Vector2 b ) : int
isHeightPassable ( Tile start, Tile end ) : bool

Private Methods

Method Description
CheckNeighbors ( Vector2 toCheck ) : Tile>.Dictionary
GetTilesInRadiusGeneric ( Vector2 center, int distance, Tile>.Func neighborsFunc, Func distanceFunc ) : Tile>.Dictionary
ReconstructPath ( Tile>.Dictionary came_from, Tile current ) : List
getValueOrMax ( int>.Dictionary dict, Tile key ) : int
heuristic_cost_estimate ( Tile start, Tile end ) : int

Method Details

Expand() public method

public Expand ( List selection, int distance ) : Tile>.Dictionary
selection List
distance int
return Tile>.Dictionary

FindPath() public method

public FindPath ( Tile start, Tile end, int maxDist, int controllingPlayerId ) : List
start Tile
end Tile
maxDist int
controllingPlayerId int
return List

GetCrossTiles() public method

public GetCrossTiles ( Vector2 center, int distance ) : Tile>.Dictionary
center Vector2
distance int
return Tile>.Dictionary

GetDiagonalNeighbors() public method

public GetDiagonalNeighbors ( Vector2 center ) : Tile>.Dictionary
center Vector2
return Tile>.Dictionary

GetDiagonalTilesInRadius() public method

public GetDiagonalTilesInRadius ( Vector2 center, int distance ) : Tile>.Dictionary
center Vector2
distance int
return Tile>.Dictionary

GetKingNeighbors() public method

public GetKingNeighbors ( Vector2 center ) : Tile>.Dictionary
center Vector2
return Tile>.Dictionary

GetKingTilesInRadius() public method

public GetKingTilesInRadius ( Vector2 center, int distance ) : Tile>.Dictionary
center Vector2
distance int
return Tile>.Dictionary

GetLineTiles() public method

public GetLineTiles ( Vector2 center, Vector2 secondPoint, int distance, bool bothDirections ) : Tile>.Dictionary
center Vector2
secondPoint Vector2
distance int
bothDirections bool
return Tile>.Dictionary

GetMovableNeighbors() public method

Find neighboring tiles that aren't occupied by enemies, but always include the dest tile for attacking if it's passed but also make sure not to land on a tile with an occupant if attacking
public GetMovableNeighbors ( Tile center, int controllingPlayerId, Tile dest = null ) : Tile>.Dictionary
center Tile
controllingPlayerId int
dest Tile
return Tile>.Dictionary

GetMovementTilesInRadius() public method

public GetMovementTilesInRadius ( Vector2 center, int distance, int controllingPlayerId ) : Tile>.Dictionary
center Vector2
distance int
controllingPlayerId int
return Tile>.Dictionary

GetNeighbors() public method

public GetNeighbors ( Vector2 center ) : Tile>.Dictionary
center Vector2
return Tile>.Dictionary

GetTilesInRadius() public method

public GetTilesInRadius ( Vector2 center, int distance ) : Tile>.Dictionary
center Vector2
distance int
return Tile>.Dictionary

KingDistance() public method

public KingDistance ( Vector2 a, Vector2 b ) : int
a Vector2
b Vector2
return int

Tile() public method

public Tile ( Vector2 position ) : Tile
position Vector2
return Tile

TileDistance() public method

public TileDistance ( Vector2 a, Vector2 b ) : int
a Vector2
b Vector2
return int

isHeightPassable() public method

public isHeightPassable ( Tile start, Tile end ) : bool
start Tile
end Tile
return bool