public void Ride() { if (Money - AttractionSettings.GetAttractionsCost() >= 0) { Money = Money - AttractionSettings.GetAttractionsCost(); LevelOfHappines++; } else { Console.WriteLine($"{Name} don't allowed to attraction, due to low balance {Money}"); } }
public void IsKidAllowedToRide(bool isAllowed, Kid kid) { if (isAllowed) { kid.Ride(); _cash = _cash + AttractionSettings.GetAttractionsCost(); } else { kid.Cry(); } }
static bool IsKidAllowed(Attractions attraction, Kid kid) { if (attraction == Attractions.Batman & kid.Height > AttractionSettings.GetMinimumHeightForBatman() & kid.Gender == Gender.Male) { return(true); } if (attraction == Attractions.Swan & kid.Gender == Gender.Female & (kid.Height > AttractionSettings.GetMinimumHeightForSwan() & kid.Height < AttractionSettings.GetMaximumHeightForSwan())) { return(true); } if (attraction == Attractions.Swan & kid.Gender == Gender.Male & kid.Height < AttractionSettings.GetMaximumHeightForSwan()) { return(true); } if (attraction == Attractions.Pony) { return(true); } return(false); }