public int EatPlant(Plant plant) { if (plant == null) return 0; // no such plant // Boar grows on each eat this.Size++; return plant.GetEatenQuantity(this.biteSize); }
public int EatPlant(Plant p) { if (p != null) { return p.GetEatenQuantity(this.biteSize); } return 0; }
public int EatPlant(Plant plant) { if (plant != null) { return plant.GetEatenQuantity(this.boarBitSize); } return 0; }
public int EatPlant(Plant plant) { if (plant != null) { this.IsEated = true; return plant.GetEatenQuantity(2); } return 0; }
public int EatPlant(Plant p) { if (p != null) { return(p.GetEatenQuantity(this.biteSize)); } return(0); }
public int EatPlant(Plant plant) { if (plant != null) { this.Size++; return plant.GetEatenQuantity(this.biteSize); } return 0; }
public int EatPlant(Plant plant) { if (plant != null) { this.Size += 1; return(plant.GetEatenQuantity(this.biteSize)); } return(0); }
public int EatPlant(Plant plant) { if (plant != null) { this.Size += 1; return plant.GetEatenQuantity(2); } return 0; }
public int EatPlant(Plant plant) { if (plant != null) { this.IsEated = true; return(plant.GetEatenQuantity(2)); } return(0); }
public int EatPlant(Plant p) { if (p != null) { this.Size++; return(p.GetEatenQuantity(BiteSize)); } return(0); }
public int EatPlant(Plant plant) { if (plant != null) { this.Grow(); return(plant.GetEatenQuantity(BitSize)); } return(0); }
public int EatPlant(Plant plant) { int eatenPlant = 0; if (plant != null) { eatenPlant = plant.GetEatenQuantity(Boar.BiteSize); this.Size++; } return eatenPlant; }
public int EatPlant(Plant plant) { if (plant != null) { this.Size++; return(plant.GetEatenQuantity(2)); } return(0); }
public int EatPlant(Plant plant) { if (plant != null) { this.Size++; return(plant.GetEatenQuantity(InitialBoarBiteSize)); } return(0); }
public int EatPlant(Plant plant) { if (plant != null) { this.Size++; return(plant.GetEatenQuantity(BoarBiteSize)); //Check if it is OK } return(0); }
public int EatPlant(Plant p) { if (p != null) { this.Size++; return p.GetEatenQuantity(BiteSize); } return 0; }
public int EatPlant(Plant plant) { int eatenPlantQuantity = 0; if (plant != null) { eatenPlantQuantity = plant.GetEatenQuantity(Boar.BoarBiteSize); this.Size++; } return(eatenPlantQuantity); }
// The Boar should be able to eat from any plant. // When eating from a plant, the Boar increases its size by 1. public int EatPlant(Plant plant) { if (plant != null) { this.Size += this.growSizeBy; return plant.GetEatenQuantity(this.biteSize); } else { return 0; } }
public int EatPlant(Plant p) { if (p == null) { return(0); } int eaten = p.GetEatenQuantity(this.biteSize); if (eaten != 0) { this.Size++; } return(eaten); }
/// <summary> /// The Boar should be able to eat from any plant. /// The Boar always has a bite size of 2. /// When eating from a plant, /// the Boar increases its size by 1. /// </summary> /// <param name="plant"></param> /// <returns></returns> public int EatPlant(Plant plant) { try { MealValidation.CheckIfMealIsNull(plant); var quantityEaten = plant.GetEatenQuantity(Boar.BiteSize); this.GrowWhenEating(Boar.GrowWhenEatingPlantsWithAmount); return(quantityEaten); } catch (Exception) { return(0); } }
public int EatPlant(Plant p) { if (p == null) return 0; int eaten = p.GetEatenQuantity(this.biteSize); if (eaten != 0) this.Size++; return eaten; }