/// 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); }
/// 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); }
public void AddOil(float amount, Liquid.Type type) { if (type == Liquid.Type.Oil) { oil += amount; if (oil > capacity) { oil = capacity; } } }
/// Recupere le nombre d'item du type type dans le stokage public float GetItemCount(Liquid.Type type) { return(stokage[type]); }
/// Verifie si il n'y a pas trop d'items public bool CanAdd(Liquid.Type type, float amount) { return(GetItemCount(type) + amount <= max); }
/// Verifie si il y a assez d'item du type type public bool CanRemove(Liquid.Type type, float amount) { return(stokage[type] - amount >= 0); }
public LiquidMove(Liquid.Type type) { this.type = type; init = new Thread(Init); init.Start(); }