Example #1
0
        public GameResult CalculateVictory(RpsWeapon player, RpsWeapon cpu)
        {
            var playerIndex = weapons.IndexOf(player);
            var cpuIndex    = weapons.IndexOf(cpu);

            return(CalculateVictory(playerIndex, cpuIndex));
        }
Example #2
0
 public RpsGameResult(
     RpsWeapon playerWeapon,
     RpsWeapon cpuWeapon,
     GameResult status,
     int?amountWon,
     int bet)
 {
     CpuWeapon    = cpuWeapon;
     PlayerWeapon = playerWeapon;
     Status       = status;
     AmountWon    = amountWon;
     Bet          = bet;
 }
Example #3
0
 public Builder WithCpuWeapon(RpsWeapon weapon)
 {
     cpuWeapon = weapon;
     return(this);
 }
Example #4
0
 public Builder WithPlayerWeapon(RpsWeapon weapon)
 {
     playerWeapon = weapon;
     return(this);
 }