Sha256: 5ee72b4dc80e8e8149a5da41aa7067eff0191b0a25a6f07e966b9ab6c4f0f2e1

Contents?: true

Size: 551 Bytes

Versions: 1

Compression:

Stored size: 551 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

1 entries across 1 versions & 1 rubygems

Version Path
software_challenge_client-0.1.1 lib/software_challenge_client/player_color.rb