private void ResetValues() { LabelResult.SetText(""); ButtonScissors.SetBackgroundColor(UIColor.White); ButtonRock.SetBackgroundColor(UIColor.White); ButtonPaper.SetBackgroundColor(UIColor.White); LabelResult.SetTextColor(UIColor.Blue); }
private void CheckMoves(Moves moveSelect) { ResetValues(); var random = new Random(); var position = random.Next(0, Options.Length); var machineChoose = Options[position]; Debug.WriteLine("Computador escolheu: " + machineChoose); if (machineChoose == moveSelect) { LabelResult.SetTextColor(UIColor.Orange); LabelResult.SetText(Results.EMPATE.ToString()); } else if (moveSelect == Moves.Rock && machineChoose == Moves.Scissors) { ButtonScissors.SetBackgroundColor(UIColor.Orange); LabelResult.SetText(Results.VITORIA.ToString()); } else if (moveSelect == Moves.Scissors && machineChoose == Moves.Paper) { ButtonPaper.SetBackgroundColor(UIColor.Orange); LabelResult.SetText(Results.VITORIA.ToString()); } else if (moveSelect == Moves.Paper && machineChoose == Moves.Rock) { ButtonRock.SetBackgroundColor(UIColor.Orange); LabelResult.SetText(Results.VITORIA.ToString()); } else { if (machineChoose == Moves.Rock) { ButtonRock.SetBackgroundColor(UIColor.Orange); } else if (machineChoose == Moves.Scissors) { ButtonScissors.SetBackgroundColor(UIColor.Orange); } else { ButtonPaper.SetBackgroundColor(UIColor.Orange); } // resultado LabelResult.SetTextColor(UIColor.Red); LabelResult.SetText(Results.PERDEU.ToString()); } }