Example #1
0
        void ReleaseDesignerOutlets()
        {
            if (LabelResult != null)
            {
                LabelResult.Dispose();
                LabelResult = null;
            }

            if (ButtonScissors != null)
            {
                ButtonScissors.Dispose();
                ButtonScissors = null;
            }

            if (ButtonPaper != null)
            {
                ButtonPaper.Dispose();
                ButtonPaper = null;
            }

            if (ButtonRock != null)
            {
                ButtonRock.Dispose();
                ButtonRock = null;
            }
        }
Example #2
0
 private void ResetValues()
 {
     LabelResult.SetText("");
     ButtonScissors.SetBackgroundColor(UIColor.White);
     ButtonRock.SetBackgroundColor(UIColor.White);
     ButtonPaper.SetBackgroundColor(UIColor.White);
     LabelResult.SetTextColor(UIColor.Blue);
 }
Example #3
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());
            }
        }
Example #4
0
 partial void CommandPaper()
 {
     CheckMoves(Moves.Paper);
     ButtonPaper.SetBackgroundColor(UIColor.Purple);
 }