Gungame51.core.players.Player
From GunGame5 Documentation
Line 10: | Line 10: | ||
description=This class is intended to be used as the class container for interaction with all GunGame-based player attributes. This class forwards to the stored [[gungame.core.players.PlayerDict|PlayerDict]] instance of the player's userid, which returns the stored player's instance of the [[gungame.core.players.BasePlayer|BasePlayer]] class. The use of this class eases the process of interacting with players, as opposed to referring to the [[gungame.core.players.PlayerDict|PlayerDict's]] instance containing the [[gungame.core.players.BasePlayer|BasePlayer]] instance of the player directly.| | description=This class is intended to be used as the class container for interaction with all GunGame-based player attributes. This class forwards to the stored [[gungame.core.players.PlayerDict|PlayerDict]] instance of the player's userid, which returns the stored player's instance of the [[gungame.core.players.BasePlayer|BasePlayer]] class. The use of this class eases the process of interacting with players, as opposed to referring to the [[gungame.core.players.PlayerDict|PlayerDict's]] instance containing the [[gungame.core.players.BasePlayer|BasePlayer]] instance of the player directly.| | ||
- | shortexample= | + | shortexample=Accessing attributes from [[gungame.core.players.BasePlayer|BasePlayer]]: |
- | + | ||
<source lang="python"></source> | <source lang="python"></source> | ||
+ | Accessing methods from [[gungame.core.players.BasePlayer|BasePlayer]]: | ||
<source lang="python"></source> | <source lang="python"></source> | ||
+ | Using the static class methods: | ||
<source lang="python"></source>| | <source lang="python"></source>| | ||
Revision as of 05:31, 28 April 2009
Contents |
Class: Player
Module: gungame.core.players
GunGame Version: 5.1
Overview
Description
This class is intended to be used as the class container for interaction with all GunGame-based player attributes. This class forwards to the stored PlayerDict instance of the player's userid, which returns the stored player's instance of the BasePlayer class. The use of this class eases the process of interacting with players, as opposed to referring to the PlayerDict's instance containing the BasePlayer instance of the player directly.
Quick Example
Accessing attributes from BasePlayer:
Accessing methods from BasePlayer:
Using the static class methods:
Methods
- __init__(userid)
Static Methods
- addAttributeCallBack(attribute, function, addon)
- removeAttributeCallBack(attribute)
- removeCallBacksForAddon(addon)
Attributes
- userid
This class allows you to both get and set attributes existing and custom attributes to the BasePlayer class. See the BasePlayer class for a list of attributes that can be used with the Player() class container.