public void Init() { structureRepo = Substitute.For <StructureRepository>(); CollectionSO collection = new CollectionSO(); testRoad = new GameObject(); testSingleStructure = new GameObject(); testZone = new GameObject(); var road = new RoadStructureSO(); road.buildingName = "Road"; road.prefab = testRoad; var facility = new SingleFacilitySO(); facility.buildingName = "PowerPlant"; facility.prefab = testSingleStructure; var zone = new ZoneStructureSO(); zone.buildingName = "Commercial"; zone.prefab = testZone; collection.roadStructure = road; collection.singleStructureList = new List <SingleStructureBaseSO>(); collection.singleStructureList.Add(facility); collection.zonesList = new List <ZoneStructureSO>(); collection.zonesList.Add(zone); structureRepo.modelDataCollection = collection; }
public void InitBeforeEveryTests() { PlacementManager placementManager = Substitute.For <PlacementManager>(); materialTransparent = new Material(Shader.Find("Standard")); placementManager.transparentMaterial = materialTransparent; GameObject ground = new GameObject(); ground.transform.position = Vector3.zero; placementManager.ground = ground.transform; StructureRepository structureRepository = Substitute.For <StructureRepository>(); CollectionSO collection = new CollectionSO(); RoadStructureSO road = new RoadStructureSO(); road.buildingName = "Road"; GameObject roadChild = new GameObject("Road", typeof(MeshRenderer)); roadChild.GetComponent <MeshRenderer>().material.color = Color.blue; GameObject roadPrefab = new GameObject("Road"); roadChild.transform.SetParent(roadPrefab.transform); road.prefab = roadPrefab; collection.roadStructure = road; structureRepository.modelDataCollection = collection; buildingManager = new BuildingManager(3, 10, 10, placementManager, structureRepository); }
public void Init() { CollectionSO collection = new CollectionSO(); var road = new RoadStructureSO(); road.buildingName = "Road"; collection.roadStructure = road; var facility = new SingleFacilitySO(); facility.buildingName = "PowerPlant"; collection.singleStructureList = new List <SingleStructureBaseSO>(); collection.singleStructureList.Add(facility); var zone = new ZoneStructureSO(); zone.buildingName = "Commercial"; collection.zonesList = new List <ZoneStructureSO>(); collection.zonesList.Add(zone); GameObject testObject = new GameObject(); repository = testObject.AddComponent <StructureRepository>(); repository.modelDataCollection = collection; }
public static StructureRepository CreateStructureRepositoryContainingRoad() { StructureRepository structureRepository = Substitute.For <StructureRepository>(); CollectionSO collection = new CollectionSO(); RoadStructureSO road = new RoadStructureSO(); road.buildingName = "Road"; road.prefab = GetAGameObjectWithMaterial(); collection.roadStructure = road; structureRepository.modelDataCollection = collection; return(structureRepository); }
public static StructureRepository CreateStructureRepositoryContainingFacility() { StructureRepository structureRepository = Substitute.For <StructureRepository>(); CollectionSO collection = ScriptableObject.CreateInstance <CollectionSO>(); SingleFacilitySO facility = ScriptableObject.CreateInstance <SingleFacilitySO>(); facility.buildingName = "Water Tower"; facility.prefab = GetAGameObjectWithMaterial(); collection.singleStructures = new List <SingleStructureBaseSO>(); collection.singleStructures.Add(facility); structureRepository.modelDataCollection = collection; return(structureRepository); }
public static StructureRepository CreateStructureRepositoryContainingZoneStructure() { StructureRepository structureRepository = Substitute.For <StructureRepository>(); CollectionSO collection = ScriptableObject.CreateInstance <CollectionSO>(); ZoneStructureSO zone = ScriptableObject.CreateInstance <ZoneStructureSO>(); GameObject TestPrefab = new GameObject(); GameObject TestPrefab2 = new GameObject(); zone.buildingName = "Commercial"; zone.prefab = GetAGameObjectWithMaterial(); zone.upgradable = true; zone.fullyUpgraded = false; zone.prefab = TestPrefab; //zone.upgradePrefab = TestPrefab2; //zone.upgradePrefabVariants = new GameObject[1]; collection.zoneStructures = new List <ZoneStructureSO>(); collection.zoneStructures.Add(zone); structureRepository.modelDataCollection = collection; return(structureRepository); }
public void Init() { CollectionSO collection = ScriptableObject.CreateInstance <CollectionSO>(); RoadStructureSO road = ScriptableObject.CreateInstance <RoadStructureSO>(); ZoneStructureSO zone = ScriptableObject.CreateInstance <ZoneStructureSO>(); SingleFacilitySO facility = ScriptableObject.CreateInstance <SingleFacilitySO>(); //SingleStructureBaseSO single = ScriptableObject.CreateInstance<SingleStructureBaseSO>(); road.buildingName = "Road"; zone.buildingName = "Commercial"; facility.buildingName = "PowerPlant"; collection.roadStructure = road; collection.singleStructures = new List <SingleStructureBaseSO>(); collection.singleStructures.Add(facility); collection.zoneStructures.Add(zone); GameObject testObject = new GameObject(); _repository = testObject.AddComponent <StructureRepository>(); _repository.modelDataCollection = collection; }