Sha256: da45a55b3cd6d996cbfd359b340c8c2c50aacbf4197a26d4f7ac68e6e67bf923
Contents?: true
Size: 570 Bytes
Versions: 4
Compression:
Stored size: 570 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.opponent_color(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
4 entries across 4 versions & 1 rubygems