ColorShapeLinks
An assignment for the AI course unit of the Bachelor in Videogames at Lusófona University
Piece Struct Reference

Represents a board piece. More...

Collaboration diagram for Piece:
Collaboration graph

Public Member Functions

 Piece (PColor color, PShape shape)
 Create a new piece. More...
 
bool Is (PColor color, PShape shape)
 Is the piece of the specified color and shape? More...
 
override string ToString ()
 Provides a string representation of the piece in the form "ColorShape". More...
 

Public Attributes

readonly PColor color
 The piece color. More...
 
readonly PShape shape
 The piece shape. More...
 

Detailed Description

Represents a board piece.

Definition at line 11 of file Piece.cs.

Constructor & Destructor Documentation

◆ Piece()

Piece ( PColor  color,
PShape  shape 
)
inline

Create a new piece.

Parameters
colorThe piece color.
shapeThe piece shape.

Definition at line 22 of file Piece.cs.

Member Function Documentation

◆ Is()

bool Is ( PColor  color,
PShape  shape 
)

Is the piece of the specified color and shape?

Parameters
colorThe piece color.
shapeThe piece shape.
Returns
true if the piece has the specified color and shape, false otherwise.

◆ ToString()

override string ToString ( )

Provides a string representation of the piece in the form "ColorShape".

Returns
A string representation of the piece.

Member Data Documentation

◆ color

readonly PColor color

The piece color.

Definition at line 14 of file Piece.cs.

◆ shape

readonly PShape shape

The piece shape.

Definition at line 17 of file Piece.cs.


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