ColorShapeLinks
An assignment for the AI course unit of the Bachelor in Videogames at Lusófona University
AIPlayer Class Referenceabstract

Base class for AI player configuration classes. More...

Inheritance diagram for AIPlayer:
Inheritance graph
Collaboration diagram for AIPlayer:
Collaboration graph

Public Member Functions

abstract void Setup ()
 This method will be called before a match starts. More...
 
override string ToString ()
 A string representation of this player. Equivalent to AIPlayer.PlayerName. More...
 

Public Attributes

bool IsActive => isActive
 Is the AI active? More...
 
bool IsHuman => false
 Is the player human? More...
 

Protected Member Functions

virtual void Awake ()
 Awake is called when the script instance is being loaded. More...
 

Properties

float AITimeLimit [get, private set]
 The time in seconds available for the AI to play. More...
 
abstract string PlayerName [get]
 The player's name. More...
 
abstract IThinker Thinker [get]
 The player's thinker. More...
 
- Properties inherited from IPlayer
bool IsHuman [get]
 Is the player human? More...
 
string PlayerName [get]
 Name of the player. More...
 
IThinker Thinker [get]
 The player's thinker. More...
 

Private Attributes

bool isActive = true
 Unity Editor variable which defines if the is active. More...
 

Detailed Description

Base class for AI player configuration classes.

Concrete AIs should extend this class and implement its abstract members. The child class should then be added as a component of the SessionConfiguration game object in the Unity editor.

Definition at line 16 of file AIPlayer.cs.

Member Function Documentation

◆ Awake()

virtual void Awake ( )
inlineprotectedvirtual

Awake is called when the script instance is being loaded.

Extending classes may override this method for their own awake-time configuration, but in doing so they must invoke the parent Awake() (this method) as follows:

base.Awake();

Definition at line 67 of file AIPlayer.cs.

◆ Setup()

abstract void Setup ( )
pure virtual

This method will be called before a match starts.

Extending classes must override this method and use it for instantianting their own implementation of IThinker.

Implemented in LoserSleeperAI, RandomAI, and SequentialAI.

◆ ToString()

override string ToString ( )

A string representation of this player. Equivalent to AIPlayer.PlayerName.

Returns
A string representation of this player.

Member Data Documentation

◆ isActive

bool isActive = true
private

Unity Editor variable which defines if the is active.

Definition at line 21 of file AIPlayer.cs.

◆ IsActive

bool IsActive => isActive

Is the AI active?

true if the AI is active, false otherwise.

Definition at line 25 of file AIPlayer.cs.

◆ IsHuman

bool IsHuman => false

Is the player human?

Always false.

See also
IPlayer.IsHuman

Definition at line 34 of file AIPlayer.cs.

Property Documentation

◆ AITimeLimit

float AITimeLimit
getprivate setprotected

The time in seconds available for the AI to play.

A time interval in seconds.

Definition at line 29 of file AIPlayer.cs.

◆ PlayerName

abstract string PlayerName
get

The player's name.

A string representing the player's name.

See also
IPlayer.PlayerName

Definition at line 39 of file AIPlayer.cs.

◆ Thinker

abstract IThinker Thinker
get

The player's thinker.

An instance of IThinker.

See also
IPlayer.Thinker

Definition at line 44 of file AIPlayer.cs.


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