示例#1
0
        private int GetUpperFillLimit(ShopFilling filling)
        {
            switch (filling)
            {
            case ShopFilling.verySparse:
            {
                return(3);
            }

            case ShopFilling.sparse:
            {
                return(5);
            }

            case ShopFilling.regular:
            {
                return(8);
            }

            case ShopFilling.filled:
            {
                return(11);
            }

            case ShopFilling.veryFilled:
            {
                return(14);
            }

            default:
            {
                throw new ArgumentException("Not implemented!");
            }
            }
        }
示例#2
0
        public Shop(Game1 Game, String identifyer)
        {
            this.Game       = Game;
            this.identifyer = identifyer;

            shopInventoryEntries = new List <ShopInventoryEntry>();
            shopInventory        = new List <Item>();
            onEnterShopInventory = new List <Item>();
            itemPool             = new List <Item>();

            // Set to none if not updated in Initialize-method
            shopFilling = ShopFilling.none;
        }
示例#3
0
        protected void InventoryItemSetup(ShopFilling filling)
        {
            FillShopInventoryWithEmptyItem();

            int items = Game.random.Next(GetLowerFillLimit(filling), GetUpperFillLimit(filling));

            for (int n = 0; n < items; n++)
            {
                if (n < mandatoryShipItems.Count)
                {
                    ShopInventoryEntry entry = mandatoryShipItems[n];

                    ShipPart part = RetrievePartFromEnum(entry.ShipPartType, Game);
                    part.SetShipPartVariety(entry.ItemVariety);
                    InsertPartAt(part, n);
                }
                else if (!inventoryIsFixed)
                {
                    ShipPart part = ExtractShipPartFromItemFrequencies();
                    InsertPartAt(part, n);
                }
            }
        }
示例#4
0
 public void SetShopFilling(ShopFilling filling)
 {
     shop.ShopFilling = filling;
 }