Esempio n. 1
0
        public YardPiece(int itemID, string name, YardItem multiParent)
            : base(itemID)
        {
            Movable = false;
            Name    = name;
            ItemID  = itemID;
            Light   = LightType.Circle150;

            if (multiParent != null)
            {
                ParentYardItem = multiParent;
            }
        }
Esempio n. 2
0
        public static void CleanYards()
        {
            if (OrphanedYardItems == null || OrphanedYardItems.Count <= 0)
            {
                return;
            }

            Console.WriteLine();
            Console.WriteLine(String.Format("Cleaning {0} Orphaned Yard Items...", OrphanedYardItems.Count));
            for (int i = 0; i < OrphanedYardItems.Count; i++)
            {
                if (OrphanedYardItems[i] is YardItem)
                {
                    YardItem item = (YardItem)OrphanedYardItems[i];
                    if (item == null)
                    {
                        continue;
                    }
                    item.FindHouseOfPlacer();
                    if (item.House == null)
                    {
                        item.Refund();
                    }
                }
                else if (OrphanedYardItems[i] is YardGate)
                {
                    YardGate item = (YardGate)OrphanedYardItems[i];
                    if (item == null)
                    {
                        continue;
                    }
                    item.FindHouseOfPlacer();
                    if (item.House == null)
                    {
                        item.Refund();
                    }
                }
            }

            OrphanedYardItems.Clear();
        }