Sha256: 521f70fd42c9b8ad1c7548db8b0b2d5936d3afe88e1eade64aac16aa9f41d78d

Contents?: true

Size: 549 Bytes

Versions: 3

Compression:

Stored size: 549 Bytes

Contents

# encoding: UTF-8
# @author Ralf-Tobias Diekert
#player color constants
module PlayerColor
  NONE = 1
  RED = 2
  BLUE = 4

  # Returns the opponents Color
  #
  # @param color [PlayerColor] The player's color, whose opponent needs to be found
  # @return [PlayerColor] the opponent's color
  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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
software_challenge_client-0.1.5 lib/software_challenge_client/player_color.rb
software_challenge_client-0.1.4 lib/software_challenge_client/player_color.rb
software_challenge_client-0.1.3 lib/software_challenge_client/player_color.rb