示例#1
0
        public Town(MainSaveFile saveFile)
        {
            SaveFile = saveFile;
            var offsets = MainOffsets.GetOffsets(SaveFile.GetRevision());

            // Load Town Data
            TownId = SaveFile.ReadStruct <TownID>(offsets.Offset_TownId);

            // Load Villagers
            for (var i = 0; i < 10; i++)
            {
                Villagers[i] = new Villager(saveFile, i);
            }

            // Load Patterns
            for (var i = 0; i < 50; i++)
            {
                Patterns[i] = new DesignPattern(saveFile, i);
            }

            // Load Buildings
            for (var i = 0; i < 46; i++)
            {
                Buildings[i] = new Building(saveFile, i);
            }

            StalkMarket = new StalkMarket(SaveFile);
        }
示例#2
0
        public Town()
        {
            var save    = MainSaveFile.Singleton();
            var offsets = MainOffsets.GetOffsets(save.GetRevision());

            // Load Town Data
            TownId = save.ReadStruct <TownID>(offsets.Offset_TownId);

            // Load Villagers
            for (var i = 0; i < 10; i++)
            {
                Villagers[i] = new Villager(i);
            }

            // Load Patterns
            for (var i = 0; i < 50; i++)
            {
                Patterns[i] = new DesignPattern(i);
            }

            // Load Buildings
            for (var i = 0; i < 46; i++)
            {
                Buildings[i] = new Building(i);
            }
        }