Ejemplo n.º 1
0
    protected override void considerBuy()
    {
        decimal  orePrice   = ((VillageSim)(Simulation.SimInstance)).Markets[(int)Profession.Miner].getLastPrice();
        RTMarket toolMarket = ((VillageSim)(Simulation.SimInstance)).Markets[(int)Profession.Blacksmith];

        if (Inventory[(int)Profession.Blacksmith] == 0)
        {
            toolMarket.searchOffer(this, (int)Profession.Blacksmith, 1, orePrice * 4);
        }

        base.considerBuy();
    }
Ejemplo n.º 2
0
    protected override void considerBuy()
    {
        RTMarket woodMarket = ((VillageSim)(Simulation.SimInstance)).Markets[(int)Profession.Lumberjack];
        RTMarket oreMarket  = ((VillageSim)(Simulation.SimInstance)).Markets[(int)Profession.Miner];
        RTMarket toolMarket = ((VillageSim)(Simulation.SimInstance)).Markets[(int)Profession.Blacksmith];

        decimal productionCosts = 1 * (woodMarket.getLastPrice() + oreMarket.getLastPrice());

        //if(toolMarket.getLastPrice() > productionCosts) {
        woodMarket.searchOffer(this, (int)Profession.Lumberjack, 2, woodMarket.getLastPrice() + 0.2m);
        oreMarket.searchOffer(this, (int)Profession.Miner, 2, oreMarket.getLastPrice() + 0.2m);
        //}
        base.considerBuy();
    }
Ejemplo n.º 3
0
    protected override void considerBuy()
    {
        RTMarket woodMarket = ((VillageSim)(Simulation.SimInstance)).Markets[(int)Profession.Lumberjack];
        RTMarket toolMarket = ((VillageSim)(Simulation.SimInstance)).Markets[(int)Profession.Blacksmith];
        decimal  foodPrice  = ((VillageSim)(Simulation.SimInstance)).Markets[(int)Profession.Farmer].getLastPrice();

        // buy wood
        if (Inventory[(int)Profession.Lumberjack] < 3)
        {
            woodMarket.searchOffer(this, (int)Profession.Lumberjack, 2, foodPrice);
        }
        // buy tools
        if (Inventory[(int)Profession.Blacksmith] == 0)
        {
            toolMarket.searchOffer(this, (int)Profession.Blacksmith, 1, foodPrice * 4);
        }
    }
Ejemplo n.º 4
0
    // buy logic
    // implementation for food
    protected virtual void considerBuy()
    {
        RTMarket foodMarket = ((VillageSim)(Simulation.SimInstance)).Markets[(int)Profession.Farmer];

        if (Inventory[(int)Profession.Farmer] < 2)
        {
            decimal lastLogPrice = foodMarket.getLastPrice();

            int buyAmmount = (int)(Cash / lastLogPrice);
            if (buyAmmount > 3)
            {
                buyAmmount = 3;
            }
            // buy max possible ammount or 3 at 0.1 more than market price
            foodMarket.searchOffer(this, (int)Profession.Farmer, buyAmmount, lastLogPrice + 10m);
        }
    }