Packagecom.electrotank.electroserver4.zone
Classpublic class Zone

This class is used to represent a zone on the server. Much like a room is a collection of users, a zone is a collection of rooms. A zone cannot be created or destroyed by itself. When a room is created a zone name is specified. If that zone doesn't exist, it is created. When no more rooms exist in that zone, it is removed.

If you loaded the list of zones by the GetZoneRequest, the response will contain a list of Zone class instances with a name and id property on each. If you belong to a room in a zone and left the join subscriptions to their default settings, then you will know the following about the zone that holds your room:



Public Methods
 MethodDefined by
  
Zone()
Creates a new instance of the Zone class.
Zone
  
addJoinedRoom(room:Room):void
Adds a room to the joinedRooms list.
Zone
  
addRoom(room:Room):void
Adds a room to the room list.
Zone
  
doesRoomExist(id:Number):Boolean
Checks to see if a room exists base don the id passed in.
Zone
  
Gets a list of rooms in this zone that you happen to be joined to.
Zone
  
getRoomById(id:Number):Room
Gets a room based on an id.
Zone
  
getRoomByName(name:String):Room
Gets a room by name.
Zone
  
getRooms():Array
Gets the room list.
Zone
  
getZoneId():Number
Gets the zone id.
Zone
  
getZoneName():String
Gets the name of the zone.
Zone
  
Removes a room from the joinedRoom list.
Zone
  
removeRoom(roomId:Number):void
Removes a room based on a room id.
Zone
  
setZoneId(num:Number):void
Sets the id of the zone.
Zone
  
setZoneName(name:String):void
Sets the name of the zone.
Zone
Constructor detail
Zone()constructor
public function Zone()

Creates a new instance of the Zone class.

Method detail
addJoinedRoom()method
public function addJoinedRoom(room:Room):void

Adds a room to the joinedRooms list.

Parameters
room:Room — The room to add.
addRoom()method 
public function addRoom(room:Room):void

Adds a room to the room list. As rooms are added to the zone on the server the client is informed of this.

Parameters
room:Room — Room to add.
doesRoomExist()method 
public function doesRoomExist(id:Number):Boolean

Checks to see if a room exists base don the id passed in.

Parameters
id:Number — Id of the room.

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

Gets a list of rooms in this zone that you happen to be joined to.

Returns
Array
getRoomById()method 
public function getRoomById(id:Number):Room

Gets a room based on an id.

Parameters
id:Number — Id of the room to find.

Returns
Room — Room whose id was passed in.
getRoomByName()method 
public function getRoomByName(name:String):Room

Gets a room by name.

Parameters
name:String — Name of the room.

Returns
Room — Reference to the room whose name was passed in.
getRooms()method 
public function getRooms():Array

Gets the room list. Each element is an instance of the Room class.

Returns
Array — The room list.
getZoneId()method 
public function getZoneId():Number

Gets the zone id.

Returns
Number — The id of the zone.
getZoneName()method 
public function getZoneName():String

Gets the name of the zone.

Returns
String — The name of the zone.
removeJoinedRoom()method 
public function removeJoinedRoom(room:Room):void

Removes a room from the joinedRoom list.

Parameters
room:Room — Room to remove.
removeRoom()method 
public function removeRoom(roomId:Number):void

Removes a room based on a room id.

Parameters
roomId:Number — Id of room to remove.
setZoneId()method 
public function setZoneId(num:Number):void

Sets the id of the zone.

Parameters
num:Number — Id of the zone.
setZoneName()method 
public function setZoneName(name:String):void

Sets the name of the zone.

Parameters
name:String — The name of the zone.