private void WriteTown(BinaryWriter w, TownObject o)
        {
            w.Write(o.Identifier);
            w.Write((byte)o.Owner);
            if (o.Name != null)
            {
                w.Write(o.Name);
            }

            if (o.Garrison != null)
            {
                WriteCreatures(w, o.Garrison);
            }

            w.Write((byte)o.GarrisonFormation);

            if (o.BuiltBuildingIds != null)
            {
                foreach (var id in o.BuiltBuildingIds)
                {
                    w.Write(id);
                }
            }

            if (o.ForbiddenBuildingIds != null)
            {
                foreach (var id in o.ForbiddenBuildingIds)
                {
                    w.Write(id);
                }
            }

            w.Write(o.HasFort);
            if (o.SpellsThatMayAppear != null)
            {
                WriteSpells(w, o.SpellsThatMayAppear);
            }

            if (o.SpellsThatMustAppear != null)
            {
                WriteSpells(w, o.SpellsThatMustAppear);
            }

            w.Write(o.AllowSpellResearch);
            WriteEvents(w, o.Events);
            w.Write((byte)o.Alignment);
        }
示例#2
0
    private void DisplayTowns(bool reset)
    {
        if (reset)
        {
            townObjects.Clear();
        }

        foreach (Town town in GameController.World.towns)
        {
            if (!townObjects.ContainsKey(town))
            {
                TownObject townObject = InstantiateOnMap(PrefabManager.Town, town.Tile.position, townsParent);
                townObject.Init(town);

                townObjects.Add(town, townObject);
            }
        }
    }
示例#3
0
 public override void OnStart()
 {
     Helpers.Logger.DBLog.InfoFormat("Type {0}", TownObject.ToString());
 }