コード例 #1
0
 public Upgrade(string _name, string _tooltip, Ressources _cost, Ressources _modifier)
 {
     name     = _name;
     tooltip  = _tooltip;
     cost     = _cost;
     modifier = _modifier;
 }
コード例 #2
0
 public Upgrade(string _name, string _tooltip, string _cost, string _modifier)
 {
     name     = _name;
     tooltip  = _tooltip;
     cost     = new Ressources(_cost);
     modifier = new Ressources(_modifier);
 }
コード例 #3
0
 public void SubRessources(Ressources subtractor)
 {
     wood -= subtractor.wood;
     food -= subtractor.food;
     ore  -= subtractor.ore;
     army -= subtractor.army;
 }
コード例 #4
0
 public void AddRessources(Ressources adder)
 {
     wood += adder.wood;
     food += adder.food;
     ore  += adder.ore;
     army += adder.army;
 }
コード例 #5
0
        public Upgrade()
        {
            name    = "no name";
            tooltip = "no tooltip";

            cost     = new Ressources();
            modifier = new Ressources();
        }
コード例 #6
0
 public bool CanAfford(Ressources price)
 {
     if (ressources.food >= price.food &&
         ressources.wood >= price.wood &&
         ressources.ore >= price.ore &&
         ressources.army >= price.army)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #7
0
 public Player(Ressources _ressources)
 {
     ressources = _ressources;
 }