/// <summary> /// Returns the state of the cell for a given coordinate /// </summary> /// <param name="coordinate"></param> /// <returns></returns> public CellState GetCellState(Coordinate3D coordinate) { return(Cells[coordinate]); }
/// <summary> /// Finds shortest path from the start to the goal. Requires pawn's movement type to operate /// </summary> /// <param name="start"></param> /// <param name="goal"></param> /// <param name="unitMovementType"></param> /// <returns></returns> public List <Coordinate3D> GetShortestPath(Coordinate3D start, Coordinate3D goal, MovementType unitMovementType) { return(AStarSearch.FindShortestPath(this, start, goal, unitMovementType)); }
/// <summary> /// Returns true if graph contains the coordinate, false otherwise /// </summary> /// <param name="coordinate"></param> /// <returns></returns> public bool Contains(Coordinate3D coordinate) { return(Cells.ContainsKey(coordinate)); }
/// <summary> /// Returns true if the cell is marked as not passable, false otherwise /// </summary> /// <param name="coordinate"></param> /// <returns></returns> public bool IsCellBlocked(Coordinate3D coordinate) { return(Cells[coordinate].IsBlocked); }
public void UnblockCells(Coordinate3D coordinate) { SetCellBlockStatus(coordinate, false); }
public void SetCellsTerrainType(Coordinate3D coordinate, TerrainType terrainType) { var cellState = GetCellState(coordinate); cellState.TerrainType = terrainType; }
public void BlockCells(Coordinate3D coordinate) { SetCellBlockStatus(coordinate, true); }
public void RemoveCell(Coordinate3D coordinate3D) { CellsList.Remove(Cells[coordinate3D]); Cells.Remove(coordinate3D); }
private bool IsPassable(Coordinate3D coordinate3D) { return(Contains(coordinate3D) && !IsCellBlocked(coordinate3D)); }
private void SetCellBlockStatus(Coordinate3D coordinate, bool isBlocked) { var cellState = GetCellState(coordinate); cellState.IsBlocked = isBlocked; }
public static string ToString(List <Coordinate3D> coordinate3Ds) { return(ToString(Coordinate3D.To2D(coordinate3Ds, OffsetTypes.OddRowsRight))); }