public void ShowSummary() { ResourceInventory inventory = ResourceInventory.Stocktake(_containers, Parsers.ParseTags(_tags), Parsers.ParseResourceFilter(_allow)); _ctx.MaxAmount = (MyFixedPoint)inventory.GetMaximum(); _panel.WriteText(_renderer.Render(inventory.GetResources().Select(resource => new ResourceItemRenderer(resource)))); }
public void TestInventoryMaximum() { ResourceInventory inventory = new ResourceInventory(new ResourceStack[] { new ResourceStack(new ResourceType("Ore", "Ice"), 48), new ResourceStack(new ResourceType("Ingot", "Iron"), 20), new ResourceStack(new ResourceType("Ingot", "Gold"), 27), new ResourceStack(new ResourceType("Ore", "Silver"), 14), new ResourceStack(new ResourceType("Ingot", "Iron"), 66), new ResourceStack(new ResourceType("Ore", "Iron"), 12) }); Assert.AreEqual(86, inventory.GetMaximum()); }