Packagecom.electrotank.electroserver4.room
Classpublic class Room

This class represents a room. This room class is internally created by the API to represent rooms. If you are joined to a room and have all of the default settings, then all properties in this room should stay up to date. When creating or joining a room you have the choice to subscribe to many room-based events, such as room variable and user variable updates.

If you are viewing a room class instance for a room that you are not in, then only the public information will be populated. That includes:



Public Methods
 MethodDefined by
  
Room()
Creates a new instance of the Room class.
Room
  
Used internally to add a room variable.
Room
  
addUser(user:User):void
Adds a usre to the room.
Room
  
doesRoomVariableExist(name:String):Boolean
Checks to see if a room variable exist based on a name.
Room
  
getCapacity():Number
Gets the room capacity.
Room
  
getDescription():String
Gets the description property of the room.
Room
  
getHasPassword():Boolean
Gets the hasPassword property.
Room
  
getIsHidden():Boolean
Gets the hidden status.
Room
  
getIsJoined():Boolean
Returns true if you are joined to this room, false otherwise.
Room
  
getPassword():String
Gets the room's password.
Room
  
getRoomId():Number
Gets the id of the room.
Room
  
getRoomName():String
Gets the name of the room.
Room
  
Finds a room variable based on the name and returns it.
Room
  
Gets the entire list of room variables.
Room
  
getUserById(str:String):User
Gets a user based on a user id.
Room
  
getUserCount():Number
Gets the user count for the room.
Room
  
getUsers():Array
Gets the full user list for this room.
Room
  
Gets the zone that the room is in.
Room
  
getZoneId():Number
Gets the id of the zone that holds the room.
Room
  
removeRoomVariable(name:String):void
Used internally to remove a room variable.
Room
  
removeUser(userId:String):void
Removes a user from the room.
Room
  
setCapacity(num:Number):void
Sets the capacity of the room.
Room
  
setDescription(des:String):void
Sets the description property of the room.
Room
  
setHasPassword(val:Boolean):void
Sets the hasPassword property of the room.
Room
  
setIsHidden(val:Boolean):void
Sets the isHidden property of the room.
Room
  
setIsJoined(isJoined:Boolean):void
Sets the isJoined property of the class intance.
Room
  
setPassword(str:String):void
Sets the room's password.
Room
  
setRoomId(rId:Number):void
Sets the id of the room.
Room
  
setRoomName(name:String):void
Sets the name of the room.
Room
  
setRoomVariables(arr:Array):void
Sets the entire list of room variables.
Room
  
setUserCount(count:Number):void
Sets the user count for the room.
Room
  
setZone(tmpzone:Zone):void
Sets the zone that the room is in.
Room
  
setZoneId(zId:Number):void
Sets the id of the zone that holds the room.
Room
Constructor detail
Room()constructor
public function Room()

Creates a new instance of the Room class.

Method detail
addRoomVariable()method
public function addRoomVariable(rv:RoomVariable):void

Used internally to add a room variable.

Parameters
rv:RoomVariable — Room variable to add to the room.
addUser()method 
public function addUser(user:User):void

Adds a usre to the room. This is used internally by the API.

Parameters
user:User — The user to be added to the room.
doesRoomVariableExist()method 
public function doesRoomVariableExist(name:String):Boolean

Checks to see if a room variable exist based on a name. If it exists then the method returns true. If it does not exist, then the method returns false.

Parameters
name:String — The name of the room variable.

Returns
Boolean — True or false.
getCapacity()method 
public function getCapacity():Number

Gets the room capacity. If -1 then there is no limit.

Returns
Number — Gets the room capacity.
getDescription()method 
public function getDescription():String

Gets the description property of the room.

Returns
String — The description property of the room.
getHasPassword()method 
public function getHasPassword():Boolean

Gets the hasPassword property.

Returns
Boolean — The hasPassword property.
getIsHidden()method 
public function getIsHidden():Boolean

Gets the hidden status.

Returns
Boolean — True or false.
getIsJoined()method 
public function getIsJoined():Boolean

Returns true if you are joined to this room, false otherwise.

Returns
Boolean — True or false.
getPassword()method 
public function getPassword():String

Gets the room's password.

Returns
String — The room's password.
getRoomId()method 
public function getRoomId():Number

Gets the id of the room.

Returns
Number — The id of the room.
getRoomName()method 
public function getRoomName():String

Gets the name of the room.

Returns
String — The name of the room.
getRoomVariable()method 
public function getRoomVariable(name:String):RoomVariable

Finds a room variable based on the name and returns it.

Parameters
name:String — Name of the room variable.

Returns
RoomVariable — Room variable instance.
getRoomVariables()method 
public function getRoomVariables():Array

Gets the entire list of room variables.

Returns
Array — The entire list of room variables.
getUserById()method 
public function getUserById(str:String):User

Gets a user based on a user id.

Parameters
str:String — The user id.

Returns
User — The user who has the id passed in.
getUserCount()method 
public function getUserCount():Number

Gets the user count for the room.

Returns
Number — The user count for the room.
getUsers()method 
public function getUsers():Array

Gets the full user list for this room.

Returns
Array — The full user list for this room.
getZone()method 
public function getZone():Zone

Gets the zone that the room is in.

Returns
Zone — The zone that the room is in.
getZoneId()method 
public function getZoneId():Number

Gets the id of the zone that holds the room.

Returns
Number — The id of the zone that holds the room.
removeRoomVariable()method 
public function removeRoomVariable(name:String):void

Used internally to remove a room variable.

Parameters
name:String — Name of room variable to remove.
removeUser()method 
public function removeUser(userId:String):void

Removes a user from the room.

Parameters
userId:String — The id of the user to remove.
setCapacity()method 
public function setCapacity(num:Number):void

Sets the capacity of the room. If -1 then there is no limit. If 1 or greater, then that is the total number of users allowed to join.

Parameters
num:Number — The room capacity.
setDescription()method 
public function setDescription(des:String):void

Sets the description property of the room.

Parameters
des:String — The description property of the room.
setHasPassword()method 
public function setHasPassword(val:Boolean):void

Sets the hasPassword property of the room. If true then a password is required to join the room.

Parameters
val:Boolean — True or false.
setIsHidden()method 
public function setIsHidden(val:Boolean):void

Sets the isHidden property of the room. If isHidden is true, then the room does not appear to exist to users not in the room.

Parameters
val:Boolean — True or false.
setIsJoined()method 
public function setIsJoined(isJoined:Boolean):void

Sets the isJoined property of the class intance. It is set to true if you are joined to the room.

Parameters
isJoined:Boolean — True or false.
setPassword()method 
public function setPassword(str:String):void

Sets the room's password.

Parameters
str:String — str
setRoomId()method 
public function setRoomId(rId:Number):void

Sets the id of the room.

Parameters
rId:Number — The id of the room.
setRoomName()method 
public function setRoomName(name:String):void

Sets the name of the room.

Parameters
name:String — The name of the room.
setRoomVariables()method 
public function setRoomVariables(arr:Array):void

Sets the entire list of room variables.

Parameters
arr:Array — List of room variables.
setUserCount()method 
public function setUserCount(count:Number):void

Sets the user count for the room.

Parameters
count:Number — The user count for the room.
setZone()method 
public function setZone(tmpzone:Zone):void

Sets the zone that the room is in.

Parameters
tmpzone:Zone — The zone tha tthe room is in.
setZoneId()method 
public function setZoneId(zId:Number):void

Sets the id of the zone that holds the room.

Parameters
zId:Number — The id of the zone that holds the room.