Beispiel #1
0
    int PickRoundWinner()
    {
        EnumSFM.SFM P1SFMChoice = P1Character.GetSFMChoosen();
        EnumSFM.SFM P2SFMChoice = P2Character.GetSFMChoosen();

        if (P1SFMChoice == EnumSFM.SFM.NONE || P2SFMChoice == EnumSFM.SFM.NONE)
        {
            return(-1);
        }
        if (P1SFMChoice == EnumSFM.SFM.ROCK)
        {
            if (P2SFMChoice == EnumSFM.SFM.PAPER)
            {
                return(2);
            }
            else if (P2SFMChoice == EnumSFM.SFM.SCISSORS)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
        else if (P1SFMChoice == EnumSFM.SFM.PAPER)
        {
            if (P2SFMChoice == EnumSFM.SFM.SCISSORS)
            {
                return(2);
            }
            else if (P2SFMChoice == EnumSFM.SFM.ROCK)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
        else if (P1SFMChoice == EnumSFM.SFM.SCISSORS)
        {
            if (P2SFMChoice == EnumSFM.SFM.ROCK)
            {
                return(2);
            }
            else if (P2SFMChoice == EnumSFM.SFM.PAPER)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
        return(-1);
    }
 public void ResetValues()
 {
     abilityChoosen = -1;
     SFMChoosen     = EnumSFM.SFM.NONE;
 }
 public void SetSFMChoosen(EnumSFM.SFM newSFM)
 {
     SFMChoosen = newSFM;
 }