コード例 #1
0
ファイル: Program.cs プロジェクト: melden19/mapz
        static void Main(string[] args)
        {
            Budget.getInstance().setLimit(5000);

            Console.WriteLine("Input city type (village, oblcenter, capital):");
            string cityType = Console.ReadLine();

            Console.WriteLine();

            ICityBuilder cityBuilder;

            switch (cityType)
            {
            case "village":
                cityBuilder = new VillageBuilder();
                break;

            case "oblcenter":
                cityBuilder = new OblCenterBuilder();
                break;

            case "capital":
                cityBuilder = new CapitalBuilder();
                break;

            default:
                throw new System.ArgumentException("City type can be only one of the following: [village, oblcenter, capital]");
            }

            BuildDirector buildDirector = new BuildDirector(cityBuilder);

            City.City city = buildDirector.Build();

            city.Info();
        }
コード例 #2
0
    // Awake Function that sets the data scripts and calls the UpdateUI function to populate the list of current saves
    public void Awake()
    {
        village = WorldData.GetComponent <VillageBuilder>();
        details = WorldData.GetComponent <Pastime>();

        UpdateUI(Directory.GetFiles(Application.persistentDataPath, "*.poop").Length, SaveList, "save");
        UpdateUI(Directory.GetFiles(Application.persistentDataPath, "*.poop").Length, LoadList, "load");
    }
コード例 #3
0
 // Function called to update the village info variables
 public void VillageInfo(VillageBuilder village)
 {
     VillageName = village.Name;
     Population  = village.Population;
     Debug.Log("VILLAGEDATA POPULATION: " + Population);
     Location        = new float[3];
     Location[0]     = village.location.x;
     Location[1]     = village.location.y;
     Location[2]     = village.location.z;
     TownProfessions = village.TownProfessions;
 }