Пример #1
0
        public static long DonationCoinOnPlayer(PlayerMobile pm)
        {
            long DonationCoins = 0;

            if (pm.BankBox != null)
            {
                DonationCoins += SearchForDonationCoin(pm.BankBox);
            }
            if (pm.Backpack != null)
            {
                DonationCoins += SearchForDonationCoin(pm.Backpack);
            }
            List <BaseHouse> houses = BaseHouse.GetHouses(pm);

            foreach (BaseHouse house in houses)
            {
                List <Item> houseitems = house.GetItems();
                foreach (Item item in houseitems)
                {
                    if (item is Container)
                    {
                        DonationCoins += SearchForDonationCoin((Container)item);
                    }
                    else if (item is DonationCoin)
                    {
                        DonationCoins += ((DonationCoin)item).Amount;
                    }
                }
            }
            if (DonationCoins > 0)
            {
                PlayerResourceAmount.AddToSortedList(new PlayerResourceAmount(pm, DonationCoins));
            }
            return(DonationCoins);
        }
Пример #2
0
 public static void AddToSortedList(PlayerResourceAmount playerResource)
 {
     for (int i = 0; i < PlayerResourceAmount.ProcessedPlayers.Count; i++)
     {
         if (playerResource.Owned > PlayerResourceAmount.ProcessedPlayers[i].Owned)
         {
             PlayerResourceAmount.ProcessedPlayers.Insert(i, playerResource);
             return;
         }
     }
     PlayerResourceAmount.ProcessedPlayers.Add(playerResource);
 }
Пример #3
0
 public static void AddToSortedList(PlayerResourceAmount playerResource)
 {
     for (int i = 0; i < PlayerResourceAmount.ProcessedPlayers.Count; i++)
     {
         if (playerResource.Owned > PlayerResourceAmount.ProcessedPlayers[i].Owned)
         {
             PlayerResourceAmount.ProcessedPlayers.Insert(i, playerResource);
             return;
         }
     }
     PlayerResourceAmount.ProcessedPlayers.Add(playerResource);
 }
Пример #4
0
        public static long GoldOnPlayer(PlayerMobile pm)
        {
            long gold = 0;

            if (pm.BankBox != null)
            {
                gold += SearchForGold(pm.BankBox);
                gold += (int)pm.BankBox.Credit;
            }
            if (pm.Backpack != null)
            {
                gold += SearchForGold(pm.Backpack);
            }
            List <BaseHouse> houses = BaseHouse.GetHouses(pm);

            foreach (BaseHouse house in houses)
            {
                List <Item> houseitems = house.GetItems();
                foreach (Item item in houseitems)
                {
                    if (item is Container)
                    {
                        gold += SearchForGold((Container)item);
                    }
                    else if (item is Gold)
                    {
                        gold += ((Gold)item).Amount;
                    }
                    else if (item is BankCheck)
                    {
                        gold += ((BankCheck)item).Worth;
                    }
                }
            }
            if (gold > 0)
            {
                PlayerResourceAmount.AddToSortedList(new PlayerResourceAmount(pm, gold));
            }
            return(gold);
        }
Пример #5
0
        public static long WoodOnPlayer(PlayerMobile pm)
        {
            long Wood = 0;

            if (pm.BankBox != null)
            {
                Wood += SearchForWood(pm.BankBox);
            }
            if (pm.Backpack != null)
            {
                Wood += SearchForWood(pm.Backpack);
            }
            List <BaseHouse> houses = BaseHouse.GetHouses(pm);

            foreach (BaseHouse house in houses)
            {
                List <Item> houseitems = house.GetItems();
                foreach (Item item in houseitems)
                {
                    if (item is Container)
                    {
                        Wood += SearchForWood((Container)item);
                    }
                    else if (item is BaseLog || item is Board)
                    {
                        Wood += item.Amount;
                    }
                    else if (item is CommodityDeed && (((CommodityDeed)item).CommodityItem is BaseLog || ((CommodityDeed)item).CommodityItem is Board))
                    {
                        Wood += ((CommodityDeed)item).CommodityItem.Amount;
                    }
                }
            }
            if (Wood > 0)
            {
                PlayerResourceAmount.AddToSortedList(new PlayerResourceAmount(pm, Wood));
            }
            return(Wood);
        }
Пример #6
0
        public static long BaseIngotOnPlayer(PlayerMobile pm)
        {
            long BaseIngots = 0;

            if (pm.BankBox != null)
            {
                BaseIngots += SearchForBaseIngot(pm.BankBox);
            }
            if (pm.Backpack != null)
            {
                BaseIngots += SearchForBaseIngot(pm.Backpack);
            }
            List <BaseHouse> houses = BaseHouse.GetHouses(pm);

            foreach (BaseHouse house in houses)
            {
                List <Item> houseitems = house.GetItems();
                foreach (Item item in houseitems)
                {
                    if (item is Container)
                    {
                        BaseIngots += SearchForBaseIngot((Container)item);
                    }
                    else if (item is BaseIngot)
                    {
                        BaseIngots += ((BaseIngot)item).Amount;
                    }
                    else if (item is CommodityDeed && ((CommodityDeed)item).CommodityItem is BaseIngot)
                    {
                        BaseIngots += ((CommodityDeed)item).CommodityItem.Amount;
                    }
                }
            }
            if (BaseIngots > 0)
            {
                PlayerResourceAmount.AddToSortedList(new PlayerResourceAmount(pm, BaseIngots));
            }
            return(BaseIngots);
        }