Esempio n. 1
0
 private void ResetValues()
 {
     LabelResult.SetText("");
     ButtonScissors.SetBackgroundColor(UIColor.White);
     ButtonRock.SetBackgroundColor(UIColor.White);
     ButtonPaper.SetBackgroundColor(UIColor.White);
     LabelResult.SetTextColor(UIColor.Blue);
 }
Esempio n. 2
0
        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());
            }
        }
Esempio n. 3
0
 partial void CommandScissors()
 {
     CheckMoves(Moves.Scissors);
     ButtonScissors.SetBackgroundColor(UIColor.Purple);
 }