///// <summary> ///// If duplicated than adds ///// </summary> //internal void add(Storage need) //{ // base.add(need); // consumedLastTurn.add(need) //} ///// <summary> ///// If duplicated than adds ///// </summary> //internal void add(PrimitiveStorageSet need) //{ } /// <summary> /// Do checks outside /// Supports takenAway /// </summary> public bool send(Producer whom, Storage what) { if (base.send(whom, what)) { used.add(what); return(true); } else { return(false); } }
/// <summary> /// checks inside (duplicates?) /// </summary> public void send(StorageSet whom, Storage howMuch) { if (has(howMuch)) { Storage targetStorage = new Storage(howMuch); whom.add(targetStorage); this.subtract(howMuch); } }
/// <summary> /// Does not take abstract products /// </summary> internal StorageSet subtractOuside(StorageSet substracting) { StorageSet result = new StorageSet(); foreach (Storage stor in substracting) { result.add(this.subtractOutside(stor)); } return(result); }
/// <summary> /// Do checks outside /// </summary> public bool send(StorageSet whom, List <Storage> what) { bool res = true; foreach (var item in what) { whom.add(item); this.subtract(item); } return(res); }
internal void sendAll(StorageSet toWhom) { toWhom.add(this); this.setZero(); }