ColorShapeLinks
An assignment for the AI course unit of the Bachelor in Videogames at Lusófona University
|
Script which controls ColorShapeLinks sessions, which can include one or more matches. More...
Public Member Functions | |
IPlayer | GetPlayer (PColor player) |
Get player of the specified color. More... | |
Public Attributes | |
Board | Board => currentBoard |
The game board. More... | |
IPlayer | CurrentPlayer => currentMatch[currentBoard.Turn] |
The current player. More... | |
float | AITimeLimit => aITimeLimit |
Maximum real time in seconds that AI can take to play. More... | |
float | MinAIGameMoveTime => minAIGameMoveTime |
Even if the AI plays immediately, this time (in seconds) gives the illusion that the AI took some minimum time to play. More... | |
float | LastMoveAnimLength => lastMoveAnimLength |
Last move animation length in seconds. More... | |
SessionState | State => state |
State of the current session. More... | |
string | PlayerWhite => currentMatch[PColor.White].PlayerName |
Name of player playing as white. More... | |
string | PlayerRed => currentMatch[PColor.Red].PlayerName |
Name of player playing as red. More... | |
IEnumerable< Match > | Matches => allMatches.Keys |
All matches played or to be played in current session. More... | |
IEnumerable< KeyValuePair< Match, Winner > > | Results |
Results of matches played so far in current session. More... | |
IEnumerable< KeyValuePair< IPlayer, int > > | Standings |
Standings (classification, ranking) of players in current session. More... | |
Winner | LastMatchResult => matchController?.Result ?? Winner.None |
Result of last match. More... | |
string | WinnerString => matchController?.WinnerString |
The winner's name and color. More... | |
bool | WhoPlaysFirst => uiWhoPlaysFirst |
Ask who plays first? More... | |
bool | BlockStartNextMatch => uiBlockStartNextMatch |
Start of next match screen needs to be unlocked with a button? More... | |
bool | BlockShowResult => uiBlockShowResult |
Show result screen needs to be unlocked with a button? More... | |
float | UnblockedScreenDuration => unblockedScreenDuration |
Duration of unblocked screens (start of next match, show result). More... | |
Private Attributes | |
int | rows = 7 |
Number of rows in the game board. More... | |
int | cols = 7 |
Number of columns in the game board. More... | |
int | winSequence = 4 |
How many pieces in a row are required to win. More... | |
int | roundPiecesPerPlayer = 10 |
Initial number of round pieces per player. More... | |
int | squarePiecesPerPlayer = 11 |
Initial number of square pieces per player. More... | |
float | lastMoveAnimLength = 1f |
Last move animation length in seconds. More... | |
float | aITimeLimit = 0.5f |
Maximum time in seconds that AI can take to play. More... | |
float | minAIGameMoveTime = 0.25f |
Minimum apparent AI move time. More... | |
int | pointsPerWin = 3 |
Tournament points per win. More... | |
int | pointsPerDraw = 1 |
Tournament points per draw. More... | |
int | pointsPerLoss = 0 |
Tournament points per loss. More... | |
bool | pressButtonBeforeMatch = false |
Press a button before tournament match starts? More... | |
bool | pressButtonAfterMatch = false |
Press a button after tournament match ends? More... | |
float | unblockedScreenDuration = 1.5f |
Duration of a screen if no button needs to be pressed in order to continue. More... | |
Additional Inherited Members | |
![]() | |
Board | Board [get] |
The game board. More... | |
IPlayer | CurrentPlayer [get] |
The current player. More... | |
float | AITimeLimit [get] |
Maximum real time in seconds that AI can take to play. More... | |
float | MinAIGameMoveTime [get] |
Even if the AI plays immediately, this time (in seconds) gives the illusion that the AI took some minimum time to play. More... | |
float | LastMoveAnimLength [get] |
Last move animation length in seconds. More... | |
![]() | |
SessionState | State [get] |
State of the current session. More... | |
string | PlayerWhite [get] |
Name of player playing as white. More... | |
string | PlayerRed [get] |
Name of player playing as red. More... | |
IEnumerable< Match > | Matches [get] |
All matches played or to be played in current session. More... | |
IEnumerable< KeyValuePair< Match, Winner > > | Results [get] |
Results of matches played so far in current session. More... | |
IEnumerable< KeyValuePair< IPlayer, int > > | Standings [get] |
Standings (classification, ranking) of players in current session. More... | |
Winner | LastMatchResult [get] |
Result of last match. More... | |
string | WinnerString [get] |
The winner's name and color. More... | |
bool | WhoPlaysFirst [get] |
Ask who plays first? More... | |
bool | BlockStartNextMatch [get] |
Start of next match screen needs to be unlocked with a button? More... | |
bool | BlockShowResult [get] |
Show result screen needs to be unlocked with a button? More... | |
float | UnblockedScreenDuration [get] |
Duration of unblocked screens (start of next match, show result). More... | |
Script which controls ColorShapeLinks sessions, which can include one or more matches.
Based on the MVC design pattern, composed in this case by the following classes:
Definition at line 25 of file SessionController.cs.
Get player of the specified color.
player | Color of the player to get. |
Implements IMatchDataProvider.
|
private |
Maximum time in seconds that AI can take to play.
Definition at line 67 of file SessionController.cs.
float AITimeLimit => aITimeLimit |
Maximum real time in seconds that AI can take to play.
Maximum real time in seconds that AI can take to play.
Definition at line 385 of file SessionController.cs.
bool BlockShowResult => uiBlockShowResult |
Show result screen needs to be unlocked with a button?
true
if show result screen needs to be unlocked with a button, false
otherwise.
Definition at line 447 of file SessionController.cs.
bool BlockStartNextMatch => uiBlockStartNextMatch |
Start of next match screen needs to be unlocked with a button?
true
if start of next match screen needs to be unlocked with a button, false
otherwise.
Definition at line 443 of file SessionController.cs.
The game board.
The game board.
Definition at line 377 of file SessionController.cs.
|
private |
Number of columns in the game board.
Definition at line 46 of file SessionController.cs.
IPlayer CurrentPlayer => currentMatch[currentBoard.Turn] |
The current player.
The current player.
Definition at line 381 of file SessionController.cs.
Winner LastMatchResult => matchController?.Result ?? Winner.None |
Result of last match.
One of the values of the Winner enumeration.
Definition at line 431 of file SessionController.cs.
|
private |
Last move animation length in seconds.
Definition at line 58 of file SessionController.cs.
float LastMoveAnimLength => lastMoveAnimLength |
Last move animation length in seconds.
Last move animation length in seconds.
Definition at line 393 of file SessionController.cs.
IEnumerable<Match> Matches => allMatches.Keys |
All matches played or to be played in current session.
Collection of matches.
Definition at line 417 of file SessionController.cs.
|
private |
Minimum apparent AI move time.
Even if the AI plays immediately, this time (in seconds) gives the illusion that the AI took some minimum time to play.
Definition at line 76 of file SessionController.cs.
float MinAIGameMoveTime => minAIGameMoveTime |
Even if the AI plays immediately, this time (in seconds) gives the illusion that the AI took some minimum time to play.
Minimum apparent AI play time.
Definition at line 389 of file SessionController.cs.
string PlayerRed => currentMatch[PColor.Red].PlayerName |
Name of player playing as red.
A string containing the player's name.
Definition at line 413 of file SessionController.cs.
string PlayerWhite => currentMatch[PColor.White].PlayerName |
Name of player playing as white.
A string containing the player's name.
Definition at line 409 of file SessionController.cs.
|
private |
Tournament points per draw.
Definition at line 87 of file SessionController.cs.
|
private |
Tournament points per loss.
Definition at line 90 of file SessionController.cs.
|
private |
Tournament points per win.
Definition at line 84 of file SessionController.cs.
|
private |
Press a button after tournament match ends?
Definition at line 96 of file SessionController.cs.
|
private |
Press a button before tournament match starts?
Definition at line 93 of file SessionController.cs.
Results of matches played so far in current session.
Collection of match-winner pairs.
Definition at line 421 of file SessionController.cs.
|
private |
Initial number of round pieces per player.
Definition at line 52 of file SessionController.cs.
|
private |
Number of rows in the game board.
Definition at line 43 of file SessionController.cs.
|
private |
Initial number of square pieces per player.
Definition at line 55 of file SessionController.cs.
IEnumerable<KeyValuePair<IPlayer, int> > Standings |
Standings (classification, ranking) of players in current session.
Descending ordered collection of player-points pairs.
Definition at line 426 of file SessionController.cs.
SessionState State => state |
State of the current session.
One of the values defined in the SessionState enumeration.
Definition at line 405 of file SessionController.cs.
|
private |
Duration of a screen if no button needs to be pressed in order to continue.
Definition at line 102 of file SessionController.cs.
float UnblockedScreenDuration => unblockedScreenDuration |
Duration of unblocked screens (start of next match, show result).
Duration in seconds.
Definition at line 451 of file SessionController.cs.
bool WhoPlaysFirst => uiWhoPlaysFirst |
Ask who plays first?
true
if UI is to ask who plays first, false
otherwise.
Definition at line 439 of file SessionController.cs.
string WinnerString => matchController?.WinnerString |
The winner's name and color.
A string containing the winner's name and color.
Definition at line 435 of file SessionController.cs.
|
private |
How many pieces in a row are required to win.
Definition at line 49 of file SessionController.cs.