示例#1
0
 /// Enleve des items de le stokage
 public bool Remove(Liquid.Type type, float amount)
 {
     if (CanRemove(type, amount))
     {
         stokage[type] -= amount;
         return(true);
     }
     return(false);
 }
示例#2
0
 /// Ajoute des items dans le stokage
 public bool Add(Liquid.Type type, float amount)
 {
     if (CanAdd(type, amount))
     {
         stokage[type] += amount;
         return(true);
     }
     return(false);
 }
示例#3
0
 public void AddOil(float amount, Liquid.Type type)
 {
     if (type == Liquid.Type.Oil)
     {
         oil += amount;
         if (oil > capacity)
         {
             oil = capacity;
         }
     }
 }
示例#4
0
 /// Recupere le nombre d'item du type type dans le stokage
 public float GetItemCount(Liquid.Type type)
 {
     return(stokage[type]);
 }
示例#5
0
 /// Verifie si il n'y a pas trop d'items
 public bool CanAdd(Liquid.Type type, float amount)
 {
     return(GetItemCount(type) + amount <= max);
 }
示例#6
0
 /// Verifie si il y a assez d'item du type type
 public bool CanRemove(Liquid.Type type, float amount)
 {
     return(stokage[type] - amount >= 0);
 }
示例#7
0
 public LiquidMove(Liquid.Type type)
 {
     this.type = type;
     init      = new Thread(Init);
     init.Start();
 }