public bool OnDonatedItemWithdrawn(ISalable salable, Farmer who, int amount) { if (salable is Item && (salable.Stack <= 0 || salable.maximumStackSize() <= 1)) { returnedDonations.Remove(salable as Item); } return(false); }
public override bool canStackWith(ISalable other) { if (other == null) { return(false); } if (!(other is CropWithDecay)) { return(false); } CropWithDecay otherCrop = (other as CropWithDecay); return((maximumStackSize() > 1) && (other.maximumStackSize() > 1) && (this.ParentSheetIndex == otherCrop.ParentSheetIndex) && (this.bigCraftable.Value == otherCrop.bigCraftable.Value) && (this.quality.Value == otherCrop.quality.Value) && this.harvestDate == otherCrop.harvestDate && (int)this.decayDays == (int)otherCrop.decayDays); }
public virtual bool canStackWith(ISalable other) { if (other == null) { return(false); } if ((other is Object && this is Object) || (other is ColoredObject && this is ColoredObject)) { if (this is ColoredObject && other is ColoredObject && !(this as ColoredObject).color.Value.Equals((other as ColoredObject).color.Value)) { return(false); } if (maximumStackSize() > 1 && other.maximumStackSize() > 1 && (this as Object).ParentSheetIndex == (other as Object).ParentSheetIndex && (this as Object).bigCraftable.Value == (other as Object).bigCraftable.Value && (this as Object).quality.Value == (other as Object).quality.Value) { return(Name.Equals(other.Name)); } return(false); } return(false); }