Beispiel #1
0
        public void CreateSpacePort()
        {
            //Arrange
            Spaceport spaceport = new Spaceport();

            //Act
            //Assert
            Assert.NotNull(spaceport);
        }
Beispiel #2
0
        public void CreateSpacePort()
        {
            //Arrange
            Spaceport spaceport = new Spaceport();

            Dictionary <string, int> shipTypes = spaceport.ShipTypes;

            //Act
            //Assert
            Assert.NotNull(spaceport);
        }
Beispiel #3
0
    public void DestroyBuilding(GameObject building)
    {
        Building b = building.GetComponent <Building>();

        b.DestroyBuildingSpecificActions();
        b.buildingSpot.GetComponent <BuildingSlot>().RemoveBuilding();

        BuildingManager.instance.buildingList.Remove(building);

        // Building type lists
        if (b.buildingType.name == "Recycling Station")
        {
            recyclingStationsList.Remove(building);
        }

        if (b.buildingType.name == "Spaceport")
        {
            Spaceport sp = building.GetComponent <Spaceport>();
            foreach (GameObject spaceship in sp.attachedSpaceships)
            {
                spaceship.GetComponent <Spaceship>().DestroySpaceship();
            }
            spaceport = null;   // Reset associated spaceport
        }

        // Unique Buildings
        if (b.buildingType.isUnique)
        {
            //ShopPanel.instance.DisplayBuildingShopItemBack(b.buildingType);       // TO REDO
        }

        EnergyPanel.instance.UpdateEnergyProductionAndConsumption();

        GameManager.instance.ChangeSelectionState(GameManager.SelectionState.Default);

        Destroy(building);
    }
        public static IList <Parkingspot> GenerateParkingspotData()
        {
            var spaceport = new Spaceport()
            {
                Id   = 500,
                Name = "Test Spaceport"
            };

            return(new List <Parkingspot>
            {
                new Parkingspot
                {
                    Id = 1,
                    Spaceport = spaceport,
                    ParkedSpaceshipId = 1,
                    ParkedSpaceship = new Spaceship()
                    {
                        Id = 1,
                        Length = 500,
                        Name = "Testship One",
                        Traveller = new Traveller()
                        {
                            Id = 1,
                            Name = "Luke Skywalker"
                        }
                    }
                },
                new Parkingspot
                {
                    Id = 2,
                    Spaceport = spaceport,
                    ParkedSpaceshipId = 2,
                    ParkedSpaceship = new Spaceship()
                    {
                        Id = 2,
                        Length = 800,
                        Name = "Testship Two",
                        Traveller = new Traveller()
                        {
                            Id = 2,
                            Name = "Anakin Skywalker"
                        }
                    }
                },
                new Parkingspot
                {
                    Id = 3,
                    Spaceport = spaceport,
                    ParkedSpaceshipId = 1,
                    ParkedSpaceship = new Spaceship()
                    {
                        Id = 1,
                        Length = 500,
                        Name = "Testship One",
                        Traveller = new Traveller()
                        {
                            Id = 2,
                            Name = "Anakin Skywalker"
                        }
                    }
                },
                new Parkingspot
                {
                    Id = 24,
                    Spaceport = spaceport,
                    ParkedSpaceship = new Spaceship()
                    {
                        Traveller = new Traveller()
                    }
                }
            });
        }