private static void Main(string[] args) { Gladiatrix tanya = new Gladiatrix { Name = "Tanya Danielle", IsQueen = true, CurrentRating = 9.01F }; Gladiatrix goldie = new Gladiatrix { Name = "Goldie Blair", IsQueen = false, CurrentRating = 8.88F }; Gladiatrix amber = new Gladiatrix { Name = "Amber Michaelle", IsQueen = false, CurrentRating = 5.98F }; Console.WriteLine(GirlDriver.CanBeDominated(tanya, goldie)); }
/// <summary> /// The class that contains method of dominating the gladiatrixes. /// </summary> /// <param name="dominating"> the object tries to dominate></param> /// <param name="dominated"> the object is subject to domination></param> /// <returns>wether first object can dominate the second</returns> public static bool CanBeDominated(Gladiatrix dominating, Gladiatrix dominated) { if (dominating.IsQueen == true) { return(true); } if (dominating.CurrentRating > dominated.CurrentRating) { return(true); } else { return(false); } }