net.sourceforge.simplegamenet.specs.to
Class PlayerSettingsMap

java.lang.Object
  extended bynet.sourceforge.simplegamenet.specs.to.PlayerSettingsMap

public class PlayerSettingsMap
extends Object

A map which contains all PlayerSettings, one for each player who joined the game session.

Version:
1.0, 2003-06-18
Author:
Geoffrey De Smet
See Also:
PlayerSettings, net.sourceforge.simplegamenet.framework.model.EngineImpl#getPlayerSettingsMap()

Constructor Summary
PlayerSettingsMap()
           
PlayerSettingsMap(Engine engine, PlayerSettings[] playerSettingsArray)
           
 
Method Summary
 void addPlayerSettings(PlayerSettings playerSettings)
          This method should only be used by the SGN framework.
 boolean containsPlayerID(Integer playerID)
          Returns true if this map contains a mapping for the specified playerID.
 boolean containsPlayerSettings(Integer playerID)
           
 int getConnectionsAmount()
          Returns the number of PlayerSettings.
 PlayerSettings getHostPlayerSettings()
          Returns the PlayerSettings of the host or null if the map contains no mapping for the host.
 Integer[] getParticipantIDs()
          Returns an array of the playerIDs of all the participants that this map contains.
 int getParticipantsAmount()
          Returns the number of participants.
 PlayerSettings[] getParticipantSettingsArray()
          Returns an array of the PlayerSettings of all the participants that this map contains.
 Integer[] getPlayerIDs()
          Returns an array of all the playerIDs that this map contains.
 PlayerSettings getPlayerSettings(Integer playerID)
          Returns the PlayerSettings to which the specified playerID is mapped in this map, or null if the map contains no mapping for the playerID.
 PlayerSettings[] getPlayerSettingsArray()
          Returns an array of all the PlayerSettings that this map contains.
 String getUniqueNickname(String nickname, Integer ignorablePlayerID)
          This method should only be used by the SGN framework.
 PlayerSettings removePlayerSettings(Integer playerID)
          This method should only be used by the SGN framework.
 void updatePlayerSettings(PlayerSettings updatedPlayerSettings)
          This method should only be used by the SGN framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlayerSettingsMap

public PlayerSettingsMap()

PlayerSettingsMap

public PlayerSettingsMap(Engine engine,
                         PlayerSettings[] playerSettingsArray)
Method Detail

containsPlayerID

public boolean containsPlayerID(Integer playerID)
Returns true if this map contains a mapping for the specified playerID.

Parameters:
playerID - the playerID whose presence in this map is to be tested
Returns:
true if this map contains a mapping for the specified playerID

getPlayerSettings

public PlayerSettings getPlayerSettings(Integer playerID)
Returns the PlayerSettings to which the specified playerID is mapped in this map, or null if the map contains no mapping for the playerID.

Parameters:
playerID - the playerID whose associated PlayerSettings is to be returned
Returns:
the PlayerSettings to which the specified playerID is mapped in this map

getHostPlayerSettings

public PlayerSettings getHostPlayerSettings()
Returns the PlayerSettings of the host or null if the map contains no mapping for the host.

Returns:
the PlayerSettings of the host

getPlayerIDs

public Integer[] getPlayerIDs()
Returns an array of all the playerIDs that this map contains.

Returns:
an array of all the playerIDs that this map contains

getPlayerSettingsArray

public PlayerSettings[] getPlayerSettingsArray()
Returns an array of all the PlayerSettings that this map contains.

Returns:
an array of all the PlayerSettings that this map contains

getParticipantIDs

public Integer[] getParticipantIDs()
Returns an array of the playerIDs of all the participants that this map contains.

Returns:
an array of the playerIDs of all the participants that this map contains

getParticipantSettingsArray

public PlayerSettings[] getParticipantSettingsArray()
Returns an array of the PlayerSettings of all the participants that this map contains.

Returns:
an array of the PlayerSettings of all the participants that this map contains

getParticipantsAmount

public int getParticipantsAmount()
Returns the number of participants.

Returns:
the number of participants

getConnectionsAmount

public int getConnectionsAmount()
Returns the number of PlayerSettings.

Returns:
the number of PlayerSettings

containsPlayerSettings

public boolean containsPlayerSettings(Integer playerID)

getUniqueNickname

public String getUniqueNickname(String nickname,
                                Integer ignorablePlayerID)
This method should only be used by the SGN framework.

Parameters:
nickname -
ignorablePlayerID -
Returns:

addPlayerSettings

public void addPlayerSettings(PlayerSettings playerSettings)
This method should only be used by the SGN framework.

Parameters:
playerSettings -

updatePlayerSettings

public void updatePlayerSettings(PlayerSettings updatedPlayerSettings)
This method should only be used by the SGN framework.

Parameters:
updatedPlayerSettings -

removePlayerSettings

public PlayerSettings removePlayerSettings(Integer playerID)
This method should only be used by the SGN framework.

Parameters:
playerID -
Returns:


Copyright © 2003-2004 The 3 Belgians. All Rights Reserved.