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!"); } } }
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; }
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); } } }
public void SetShopFilling(ShopFilling filling) { shop.ShopFilling = filling; }