• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

ksquares

Public Member Functions | Protected Attributes | List of all members
KSquaresPlayer Class Reference

#include <ksquaresplayer.h>

Public Member Functions

 KSquaresPlayer (const QString &newName, const QColor &newColor, bool isPlayerHuman=true)
 
 KSquaresPlayer ()
 
QColor colour () const
 
void incScore ()
 
bool isHuman () const
 
QString name () const
 
bool operator< (const KSquaresPlayer &player) const
 
int score () const
 
void setName (const QString &newName)
 
void setScore (int newScore)
 
QString sig () const
 

Protected Attributes

QString displaySig
 
bool human
 
QColor playerColour
 
QString playerName
 
int playerScore
 

Detailed Description

Player class for KSquares.

Class containing All the information about a player.

Author
Matt Williams matt@.nosp@m.mill.nosp@m.iams..nosp@m.com

Definition at line 23 of file ksquaresplayer.h.

Constructor & Destructor Documentation

KSquaresPlayer::KSquaresPlayer ( const QString &  newName,
const QColor &  newColor,
bool  isPlayerHuman = true 
)
inlineexplicit

Creates a player.

Parameters
newNameThe displayable name of the player
newColorthe colour used to fill the player's boxes
isPlayerHumanis the player human (or AI)

Definition at line 33 of file ksquaresplayer.h.

KSquaresPlayer::KSquaresPlayer ( )
inline

Create a null player.

Definition at line 36 of file ksquaresplayer.h.

Member Function Documentation

QColor KSquaresPlayer::colour ( ) const
inline
Returns
the player's chosen display colour

Definition at line 73 of file ksquaresplayer.h.

void KSquaresPlayer::incScore ( )
inline

Increase the players score by 1.

Definition at line 63 of file ksquaresplayer.h.

bool KSquaresPlayer::isHuman ( ) const
inline
Returns
Is the player human

Definition at line 68 of file ksquaresplayer.h.

QString KSquaresPlayer::name ( ) const
inline

Sets the players name.

Returns
The displayable name of the player

Definition at line 50 of file ksquaresplayer.h.

bool KSquaresPlayer::operator< ( const KSquaresPlayer &  player) const
inline

Used in sort algorithm.

Compares the player's score (not their height or age or anything :D)

Parameters
playerthe player to compare wth this one
Returns
true if player is bigger than this

Definition at line 85 of file ksquaresplayer.h.

int KSquaresPlayer::score ( ) const
inline
Returns
The players current score

Definition at line 61 of file ksquaresplayer.h.

void KSquaresPlayer::setName ( const QString &  newName)
inline

Sets the players name.

Parameters
newNameThe displayable name of the player

Definition at line 43 of file ksquaresplayer.h.

void KSquaresPlayer::setScore ( int  newScore)
inline

Sets the players score.

Parameters
newScoreThe players new score

Definition at line 57 of file ksquaresplayer.h.

QString KSquaresPlayer::sig ( ) const
inline
Returns
the player's signature (1 or 2 letters)

Definition at line 78 of file ksquaresplayer.h.

Member Data Documentation

QString KSquaresPlayer::displaySig
protected

Letter (or two) to display on the board.

Definition at line 97 of file ksquaresplayer.h.

bool KSquaresPlayer::human
protected

Is the player a human.

Definition at line 89 of file ksquaresplayer.h.

QColor KSquaresPlayer::playerColour
protected

Player's display colour.

Definition at line 95 of file ksquaresplayer.h.

QString KSquaresPlayer::playerName
protected

The player's displayable name.

Definition at line 93 of file ksquaresplayer.h.

int KSquaresPlayer::playerScore
protected

Player's current score.

Definition at line 91 of file ksquaresplayer.h.


The documentation for this class was generated from the following file:
  • ksquaresplayer.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ksquares

Skip menu "ksquares"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal