public void FoundTime(int numberOfGames, ref List <Game> gameArr) { int time; EventHandler <Game> pr = Game.ShortInfo; Console.WriteLine("Enter how much time you are willing to spend on the game : "); time = ValidationInt(); Console.WriteLine("Games suitable for you: "); for (int i = 0; i < numberOfGames; i++) { if (gameArr[i].TimeSearch(time) == 1) { ElementFound?.Invoke(this, gameArr[i]); Console.WriteLine(""); } } }
public void FoundDoubleReating(int numberOfGames, ref List <Game> gameArr) { float reatingFirst, reatingSecond; EventHandler <Game> pr = Game.ShortInfo; Console.WriteLine("Enter the minimum player rating: "); reatingFirst = Validationfloat(); Console.WriteLine("Enter the minimum press rating: "); reatingSecond = Validationfloat(); Console.WriteLine("Games suitable for you: "); for (int i = 0; i < numberOfGames; i++) { if (gameArr[i].DoubleReatingSearch(reatingFirst, reatingSecond) == 1) { ElementFound?.Invoke(this, gameArr[i]); Console.WriteLine(""); } } }
public void FoundAgeReating(int numberOfGames, ref List <Game> gameArr) { float reatingFirst; int age; EventHandler <Game> pr = Game.ShortInfo; Console.WriteLine("Enter what age rating do you belong to: "); age = ValidationAgeRating(); Console.WriteLine("Enter minimum rating(player or press): "); reatingFirst = Validationfloat(); Console.WriteLine("Games suitable for you: "); for (int i = 0; i < numberOfGames; i++) { for (int j = 0; j <= age; j++) { if (gameArr[i].ReatingSearch(reatingFirst) == 1 && (gameArr[i])[j] == 1) { ElementFound?.Invoke(this, gameArr[i]); Console.WriteLine(""); } } } }
public void OnElementFound(EventArgs e) { Automation.RemoveAllEventHandlers(); ElementFound?.Invoke(this, e); }