Exemplo n.º 1
0
    public void AddResource(Resource resource, InventoryItem.ActionType action, float max, float ideal, float amount = 0)
    {
        float      priceMin   = (float)Math.Floor(resource.BasePrice);
        float      priceMax   = (float)Math.Ceiling(resource.BasePrice + resource.BasePrice * 0.75f);
        PriceRange priceRange = new PriceRange(priceMin, priceMax);

        InventoryItem row = new InventoryItem(resource, action, priceRange, max, ideal, amount);

        Inventory.Add(resource.Type, row);
    }
    public new void AddResource(Resource resource, InventoryItem.ActionType action, float max, float ideal, float amount = 0)
    {
        AddSelfToMarket(resource);

        float      priceMin   = (float)Math.Round(resource.BasePrice - resource.BasePrice * 0.5);
        float      priceMax   = (float)Math.Round(resource.BasePrice + resource.BasePrice * 0.5);
        PriceRange priceRange = new PriceRange(priceMin, priceMax);

        InventoryItem row = new InventoryItem(resource, action, priceRange, max, ideal, amount);

        if (action == InventoryItem.ActionType.sell)
        {
            CommodityProduced = resource;
        }

        Inventory.Add(resource.Type, row);
    }