public static HexEdgeData GetClockwiseEdge(HexTileData hexTileData, HexEdgeData currentHex, int index) { var size = currentHex.MyHexTile.HexEdgesData.Count; var newIndex = ((int)currentHex.HexDiraction + size + index) % size; return(hexTileData.HexEdgesData[newIndex]); }
public static bool CityEdgesCheck(List <HexEdgeData> visited, HexEdgeData edge) { visited.Add(edge); var clockwiseEdge = HexUtils.GetClockwiseEdge(edge.MyHexTile, edge, 1); var antiClockwiseEdge = HexUtils.GetClockwiseEdge(edge.MyHexTile, edge, -1); if (!CityEdgeCheck(visited, edge.HexEdgeType, clockwiseEdge)) { return(false); } if (!CityEdgeCheck(visited, edge.HexEdgeType, antiClockwiseEdge)) { return(false); } if (edge.IsOpen) { var connected = HexUtils.GetConnectedEdge(edge.MyHexTile, edge); if (connected.MyHexTile.Owner != Player.MyPlayer) { return(false); } if (!CityEdgeCheck(visited, edge.HexEdgeType, connected)) { return(false); } } return(true); }
public static HexEdgeData GetConnectedEdge(HexTileData hexTileData, HexEdgeData edgeData) { var hexDiraction = edgeData.HexDiraction; var hexTile = GridManager.Singleton.GetHex(hexTileData.GetVector()); var nieghborTile = GetNeighborTile(hexTile, hexDiraction); if (nieghborTile == null) { return(null); } return(nieghborTile.Data.HexEdgesData[(int)HexUtils.OppsiteHex[hexDiraction]]); }
public static Price CalcHexEdgePrice(HexEdgeData hexEdgeData) { return(Configuration.Singleton.GetPriceOfType(hexEdgeData.HexEdgeType)); }
public static bool CityEdgeCheck(List <HexEdgeData> visited, HexEdgeType hexEdgeType, HexEdgeData edge) { if (!visited.Contains(edge) && edge.HexEdgeType == hexEdgeType) { if (!CityEdgesCheck(visited, edge)) { return(false); } } return(true); }
public static List <HexEdgeData> CityCompleteCheck(HexTile hexTile, HexEdgeData edgeDate) { var visited = new List <HexEdgeData>();//will check if the city is complete return(visited); }
public void Init(HexEdgeData hexEdgeData) { HexEdgeData = hexEdgeData; }