Logo Search packages:      
Sourcecode: balazar3 version File versions  Download package

def balazar3-0.1::tofu::Player::get_or_create (   Class,
  player_id 
)

Player.get_or_create(player_id) -> Player

Returns the Player identified by PlayerID.

If the Player already exists, it is returned.
Else, if there is a file for this Player, loads it and returns the Player.
Else, a new Player is created and returned.

Definition at line 859 of file __init__.py.

00859                                      :
    """Player.get_or_create(player_id) -> Player

Returns the Player identified by PlayerID.

If the Player already exists, it is returned.
Else, if there is a file for this Player, loads it and returns the Player.
Else, a new Player is created and returned."""
    if not player_id.filename in Class.availables(): return CREATE_PLAYER(player_id)
    player = Class.get(player_id.filename)
    if player_id.password != player.password: raise ValueError("Wrong password!")
    return player
    
  def __init__(self, player_id):


Generated by  Doxygen 1.6.0   Back to index