Пример #1
0
 private void AdjustStructureIfIsInDictionary(Vector3Int?neighbourGridPosition, Vector3Int neighbourPositionInt)
 {
     if (RoadManager.CheckIfNeighbourIsRoadInDictionary(neighbourPositionInt, structuresToBeModified))
     {
         RevokeRoadPlacementAt(neighbourPositionInt);
         var neighboursStructure = RoadManager.GetCorrectRoadPrefab(neighbourGridPosition.Value, structureData, structuresToBeModified, grid);
         PlaceNewRoadAt(neighboursStructure, neighbourGridPosition.Value, neighbourPositionInt);
     }
 }
Пример #2
0
        public void RoadManagerTestsCheckIfNeighbourIsRoadInDictionaryFalse()
        {
            var dictionary = new Dictionary <Vector3Int, GameObject>();
            var position   = new Vector3Int(3, 0, 6);

            dictionary.Add(position, roadStraight);
            var result = RoadManager.CheckIfNeighbourIsRoadInDictionary(new Vector3Int(6, 0, 6), dictionary);

            Assert.IsFalse(result);
        }