public void SetPathOverlay(int Index, TilePathOverlay PathOverlay) { Configuration.SetPathOverlay(Index, PathOverlay); if (NeighborTiles[Index] != null && NeighborTiles[Index].Configuration.GetPathOverlay((Index + 3) % 6) != PathOverlay) { NeighborTiles[Index].SetPathOverlay((Index + 3) % 6, PathOverlay); } }
void MakePath(Tile Start, Tile End, TilePathOverlay Path, Func <Tile, Tile, double> DistanceFunction) { var path = new Path <Tile>( Start, End, i => true, DistanceFunction, (i, j) => i.HeuristicDistanceTo(j), i => i.Neighbors(), (i, j) => i == j); for (int i = 0; i < path.Count - 1; ++i) { path[i].SetPathOverlay(Array.IndexOf(path[i].NeighborTiles, path[i + 1]), Path); } }
Tuple <int, int> GetDisconntedNeighbor(TilePathOverlay Overlay) { for (int i = 0; i < 6; ++i) { for (int j = 0; j < 6; ++j) { if (NeighborTiles[i].Configuration.GetPathOverlay(j) == Overlay && NeighborTiles[i].NeighborTiles[j].Configuration.GetPathOverlay( (j + 3) % 6) == TilePathOverlay.NONE) { return(new Tuple <int, int>(i, j)); } } } return(null); }
void EdgePathOverlay(Tile Tile, TilePathOverlay Path) { if (Tile.OnEdge(Direction.NORTH)) { Tile.SetPathOverlay(2, Path); } else if (Tile.OnEdge(Direction.SOUTH)) { Tile.SetPathOverlay(4, Path); } else if (Tile.OnEdge(Direction.WEST)) { Tile.SetPathOverlay(0, Path); } else if (Tile.OnEdge(Direction.EAST)) { Tile.SetPathOverlay(3, Path); } }
public void SetPathOverlay(int Index, TilePathOverlay PathOverlay) { _PathOverlays[Index] = PathOverlay; TriggerReconfigure(); }
public bool HasPathOverlay(TilePathOverlay PathOverlay) { return(_PathOverlays.Any(i => i == PathOverlay)); }
public TileHasPath(ParseBlock Block) { var attributes = Block.BreakToAttributes <object>(typeof(Attribute)); Path = (TilePathOverlay)attributes[(int)Attribute.PATH]; }
public TileHasPath(TilePathOverlay Path) { this.Path = Path; }
float PathBorderWidth(TilePathOverlay PathOverlay) { return(_PathBorderWidths[(int)PathOverlay]); }
Color PathBorderColor(TilePathOverlay PathOverlay) { return(_PathBorderColors[(int)PathOverlay]); }
public TileComponentRules GetRules(TilePathOverlay Type) { return(_PathOverlayRules[(int)Type]); }