Skip to content

PlayerStats

Gabriël edited this page Nov 1, 2021 · 2 revisions

The PlayerStats class holds statistics on individual players.

Fields

  • index: int - The index of this player in the game.
  • name: str - The name of the player (not custom AI name, but 'real' .per file name)
  • alive: bool - Whether this player is still alive in the game.
  • score: int - The current score of this player

Functions

PlayerStats(index, name) - Instantiate a new instance of this class.

Required Parameters

  • index: int - The index of this player in the game.
  • name: str - The name of this player.

Returns

A new instance of this class.


PlayerStats.update(score, alive) - Update the score and alive status for this player

Required Parameters

  • score: int - The score for this player.
  • alive: bool - The alive status for this player.

Returns

Nothing.

Clone this wiki locally