ColorShapeLinks AI
An AI competition for the IEEE Conference on Games 2021
PColorExtensions Class Reference

Extension methods for the PColor enum. More...

+ Collaboration diagram for PColorExtensions:

Static Public Member Functions

static string FormatName (this PColor color, string name)
 Provides a consistent way to get a formatted thinker name which includes the color with which he's playing. More...
 
static PColor Other (this PColor color)
 Returns the other color. More...
 
static PShape Shape (this PColor color)
 Returns the shape associated with this player's color for winning purposes. More...
 
static bool FriendOf (this PColor color, Piece piece)
 Is the given piece a friend of this color? In other words, is the given piece of the same color as this color or associated with the same shape for winning purposes as this color? More...
 
static Winner ToWinner (this PColor color)
 Returns the Winner associated with this color. More...
 

Detailed Description

Extension methods for the PColor enum.

Member Function Documentation

◆ FormatName()

static string FormatName ( this PColor  color,
string  name 
)
static

Provides a consistent way to get a formatted thinker name which includes the color with which he's playing.

Parameters
colorThinker's color.
nameThinker's name.
Returns
A formatted thinker name with color.

◆ FriendOf()

static bool FriendOf ( this PColor  color,
Piece  piece 
)
static

Is the given piece a friend of this color? In other words, is the given piece of the same color as this color or associated with the same shape for winning purposes as this color?

Parameters
colorThis color.
pieceThe piece to check for friendship.
Returns
true is given piece is a friend, false otherwise.

◆ Other()

static PColor Other ( this PColor  color)
static

Returns the other color.

Parameters
colorThis color.
Returns

◆ Shape()

static PShape Shape ( this PColor  color)
static

Returns the shape associated with this player's color for winning purposes.

Parameters
colorThis color.
Returns

◆ ToWinner()

static Winner ToWinner ( this PColor  color)
static

Returns the Winner associated with this color.

Parameters
colorThis color.
Returns

The documentation for this class was generated from the following file: