예제 #1
0
        public void RoadManagerTestsCheckIfNeighbourIsRoadOnGridFalse()
        {
            var position = new Vector3Int(0, 0, 0);
            var result   = RoadManager.CheckIfNeighbourIsRoadOnTheGrid(grid, position);

            Assert.IsFalse(result);
        }
예제 #2
0
 private void RevokeStructureDemolitionAt(Vector3Int gridPositionInt, GameObject structure)
 {
     placementManager.ResetBuildingLook(structure);
     structuresToBeModified.Remove(gridPositionInt);
     if (RoadManager.CheckIfNeighbourIsRoadOnTheGrid(grid, gridPositionInt) && roadToDemolish.ContainsKey(gridPositionInt))
     {
         roadToDemolish.Remove(gridPositionInt);
     }
 }
예제 #3
0
 private void AddStructureForDemolition(Vector3Int gridPositionInt, GameObject structure)
 {
     structuresToBeModified.Add(gridPositionInt, structure);
     placementManager.SetBuildingForDemolition(structure);
     if (RoadManager.CheckIfNeighbourIsRoadOnTheGrid(grid, gridPositionInt) && roadToDemolish.ContainsKey(gridPositionInt) == false)
     {
         roadToDemolish.Add(gridPositionInt, structure);
     }
 }
예제 #4
0
 private void AdjustStructureIfIsOnGrid(Vector3Int?neighbourGridPosition, Vector3Int neighbourPositionInt)
 {
     if (RoadManager.CheckIfNeighbourIsRoadOnTheGrid(grid, neighbourPositionInt))
     {
         var neighbourStructureData = grid.GetStructureDataFromTheGrid(neighbourGridPosition.Value);
         if (neighbourStructureData != null && neighbourStructureData.GetType() == typeof(RoadStructureSO) && existingRoadStructuresToModify.ContainsKey(neighbourPositionInt) == false)
         {
             existingRoadStructuresToModify.Add(neighbourPositionInt, grid.GetStructureFromTheGrid(neighbourGridPosition.Value));
         }
     }
 }