Sha256: de0f06f2c08751ab3103f96b0dc3ba990621eea4fb53fadf7767dd0b8dc16554
Contents?: true
Size: 569 Bytes
Versions: 6
Compression:
Stored size: 569 Bytes
Contents
# encoding: UTF-8 # player color constants require 'typesafe_enum' class PlayerColor < TypesafeEnum::Base new :NONE new :RED new :BLUE # 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
6 entries across 6 versions & 1 rubygems