Module: PlayerColor

Defined in:
lib/software_challenge_client/player_color.rb

Overview

player color constants

Author:

  • Ralf-Tobias Diekert

Constant Summary collapse

NONE =
1
RED =
2
BLUE =
4

Class Method Summary collapse

Class Method Details

.opponentColor(color) ⇒ PlayerColor

Returns the opponents Color



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/software_challenge_client/player_color.rb', line 12

def self.opponentColor(color)
  if color == PlayerColor::RED
    return PlayerColor::BLUE
  end
  if color == PlayerColor::BLUE
    return PlayerColor::RED
  end
  if color == PlayerColor::NONE
    return PlayerColor::NONE
  end
end