示例#1
0
 public Tresource(Eresourcetype _ert, string _name, int _p, int _g, int _f, string _exploit, Etilesprite _tile, string _explain, bool destroyed)
 {
     ert                 = _ert;
     yieldwhenworked     = new yields(_p, _g, _f);
     name                = _name;
     nameofexploiter     = _exploit;
     tile                = _tile;
     explain             = _explain;
     destroyedbybuilding = destroyed;
 }
    public static yields operator +(yields a, yields b)
    {
        yields temp = new yields(a.production, a.gold, a.food);

        temp.production += b.production;
        temp.gold       += b.gold;
        temp.food       += b.food;

        return(temp);
    }
示例#3
0
    public void recalcyield()
    {
        //add up the "currentyield" in each square this city owns
        //currentyield is the base yield of the tile plus any improvements like worked resources, mines or farms
        yields y = new yields(0, 0, 0);

        foreach (var x in influenced)
        {
            y.add(map.currentyield[x.x, x.y]);
        }
        // Debug.Log("yield now " + y.production + " " + y.gold + " " + y.food);
        perturnyields = y;
    }
 public void add(yields y)
 {
     production += y.production;
     gold       += y.gold;
     food       += y.food;
 }
 public yields(yields a)
 {
     production = a.production;
     gold       = a.gold;
     food       = a.food;
 }