Example #1
0
    public void RegistarPlanetToData(SpacePlanet X)
    {
        //Make A new Planet
        Planet N = new Planet(X.PlanetID);

        for (int i = 0; i < X.NumberFarms; i++)
        {
            N.AddBuilding(new Farm());
        }
        for (int i = 0; i < X.NumberMines; i++)
        {
            N.AddBuilding(new Mine());
        }
        for (int i = 0; i < X.NumberSmelters; i++)
        {
            N.AddBuilding(new Smelter());
        }
        for (int i = 0; i < X.NumberFactories; i++)
        {
            N.AddBuilding(new Factory());
        }
        for (int i = 0; i < X.NumberCitiesAndLevel.Count; i++)
        {
            for (int J = 0; J < X.NumberCitiesAndLevel[i]; J++)
            {
                N.AddBuilding(new City(i + 1));
            }
        }
        DataManager.Data.LoadPlanet(N);
    }