Example #1
0
        public static void FactionTownReset_OnCommand(CommandEventArgs e)
        {
            MonolithCollection monoliths = BaseMonolith.Monoliths;

            for (int i = 0; i < monoliths.Count; ++i)
            {
                monoliths[i].Sigil = null;
            }

            TownCollection towns = Town.Towns;

            for (int i = 0; i < towns.Count; ++i)
            {
                towns[i].Silver  = 0;
                towns[i].Sheriff = null;
                towns[i].Finance = null;
                towns[i].Tax     = 0;
                towns[i].Owner   = null;
            }

            SigilCollection sigils = Sigil.Sigils;

            for (int i = 0; i < sigils.Count; ++i)
            {
                sigils[i].Corrupted         = null;
                sigils[i].Corrupting        = null;
                sigils[i].LastStolen        = DateTime.MinValue;
                sigils[i].GraceStart        = DateTime.MinValue;
                sigils[i].CorruptionStart   = DateTime.MinValue;
                sigils[i].PurificationStart = DateTime.MinValue;
                sigils[i].LastMonolith      = null;
                sigils[i].ReturnHome();
            }

            FactionCollection factions = Faction.Factions;

            for (int i = 0; i < factions.Count; ++i)
            {
                Faction f = factions[i];

                ArrayList list = new ArrayList(f.State.FactionItems);

                for (int j = 0; j < list.Count; ++j)
                {
                    FactionItem fi = (FactionItem)list[j];

                    if (fi.Expiration == DateTime.MinValue)
                    {
                        fi.Item.Delete();
                    }
                    else
                    {
                        fi.Detach();
                    }
                }
            }
        }
 /// <summary>
 /// Default constructor for enumerator.
 /// </summary>
 /// <param name="collection">Instance of the collection to enumerate.</param>
 internal MonolithCollectionEnumerator(MonolithCollection collection)
 {
     _index = -1;
     _collection = collection;
 }
 /// <summary>
 /// Default constructor for enumerator.
 /// </summary>
 /// <param name="collection">Instance of the collection to enumerate.</param>
 internal MonolithCollectionEnumerator(MonolithCollection collection)
 {
     _index      = -1;
     _collection = collection;
 }