# INFSmartFoxRoom Class Reference

List of all members.

## Public Member Functions
(void) | - addUser:id:
(void) | - clearUserList
(void) | - clearVariables
(NSInteger) | - getId
(NSInteger) | - getMaxSpectators
(NSInteger) | - getMaxUsers
(NSInteger) | - getMyPlayerIndex
(NSString *) | - getName
(NSInteger) | - getSpectatorCount
(INFSmartFoxUser *) | - getUser:
(NSInteger) | - getUserCount
(NSMutableDictionary *) | - getUserList
(id) | - getVariable:
(NSMutableDictionary *) | - getVariables
(id) | - initWithParams:name:maxUsers:maxSpectators:isTemp:isGame:isPrivate:isLimbo:userCount:specCount:
(BOOL) | - isGame
(BOOL) | - isLimbo
(BOOL) | - isPrivate
(BOOL) | - isTemp
(void) | - removeUser:
(void) | - setIsLimbo:
(void) | - setMyPlayerIndex:
(void) | - setSpectatorCount:
(void) | - setUserCount:
(void) | - setVariables:
## Static Public Member Functions
(id) | + room:name:maxUsers:maxSpectators:isTemp:isGame:isPrivate:isLimbo:userCount:specCount:

## Detailed Description

The Room class stores the properties of each server room. This class is used internally by the INFSmartFoxiPhoneClient class; also, Room objects are returned by various methods and events of the SmartFoxServer API.

NOTE: in the provided examples, room always indicates a Room instance.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  1.0.0

## Member Function Documentation

- (void) addUser: |  | (INFSmartFoxUser *) | u
id: |  | (NSInteger) | id |

Add a user to the room.

Parameters:

  | u | : the INFSmartFoxUser object.
  | id | : the user id.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (void) clearUserList |  |  |  |

Reset users list.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (void) clearVariables |  |  |  |

Reset Room Variables.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (NSInteger) getId |  |  |  |

Get the id of the room.

Returns:
  The id of the room.

See also:
  - getName

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSInteger) getMaxSpectators |  |  |  |

Retrieve the maximum number of spectators that can join the room. Spectators can exist in game rooms only.

Returns:
  The maximum number of spectators that can join the room.

See also:
  - getMaxUsers

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSInteger) getMaxUsers |  |  |  |

Retrieve the maximum number of users that can join the room.

Returns:
  The maximum number of users that can join the room.

See also:
  - getMaxSpectators

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSInteger) getMyPlayerIndex |  |  |  |

Retrieve the player id for the current user in the room. This id is 1-based (player 1, player 2, etc.), but if the user is a spectator its value is -1.

Returns:
  The player id for the current user.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSString *) getName |  |  |  |

Get the name of the room.

Returns:
  The name of the room.

See also:
  - getId

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSInteger) getSpectatorCount |  |  |  |

Retrieve the number of spectators currently inside the room.

Returns:
  The number of spectators in the room.

See also:
  - getUserCount

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (INFSmartFoxUser *) getUser: |  | (id) | userId |  |

Retrieve a user currently in the room.

Parameters:

  | userId | : the user name (String) or the id (int) of the user to retrieve.

Returns:
  A INFSmartFoxUser object.

See also:
  - getUserList

  INFSmartFoxUser

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSInteger) getUserCount |  |  |  |

Retrieve the number of users currently inside the room.

Returns:
  The number of users in the room.

See also:
  - getSpectatorCount

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSMutableDictionary *) getUserList |  |  |  |

Get the list of users currently inside the room. As the returned list is an associative array with user id(s) as keys, in order to iterate it a for-in loop or a for-each loop should be used.

Returns:
  A list of INFSmartFoxUser objects.

See also:
  - getUser:

  INFSmartFoxUser

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (id) getVariable: |  | (NSString *) | varName |  |

Retrieve a Room Variable.

Parameters:

  | varName | : the name of the variable to retrieve.

Returns:
  The Room Variable's value.

See also:
  - getVariables

  - setRoomVariables:roomId:setOwnership: (INFSmartFoxiPhoneClient)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSMutableDictionary *) getVariables |  |  |  |

Retrieve the list of all Room Variables.

Returns:
  An associative array containing Room Variables' values, where the key is the variable name.

See also:
  - getVariable:

  - setRoomVariables:roomId:setOwnership: (INFSmartFoxiPhoneClient)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (id) initWithParams: |  | (NSInteger) | id
name: |  | (NSString *) | name
maxUsers: |  | (NSInteger) | maxUsers
maxSpectators: |  | (NSInteger) | maxSpectators
isTemp: |  | (BOOL) | isTemp
isGame: |  | (BOOL) | isGame
isPrivate: |  | (BOOL) | isPrivate
isLimbo: |  | (BOOL) | isLimbo
userCount: |  | (NSInteger) | userCount
specCount: |  | (NSInteger) | specCount |

- (BOOL) isGame |  |  |  |

A boolean flag indicating if the room is a "game room".

Returns:
  true if the room is a "game room".

See also:
  - isLimbo

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (BOOL) isLimbo |  |  |  |

A boolean flag indicating if the room is in "limbo mode".

Returns:
  true if the room is in "limbo mode".

See also:
  - isGame

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (BOOL) isPrivate |  |  |  |

A boolean flag indicating if the room is private (password protected).

Returns:
  true if the room is private.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (BOOL) isTemp |  |  |  |

A boolean flag indicating if the room is dynamic/temporary. This is always true for rooms created at runtime on client-side.

Returns:
  true if the room is a dynamic/temporary room.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) removeUser: |  | (NSInteger) | id |  |

Remove a user from the room.

Parameters:

  | id | : the user id.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

+ (id) room: |  | (NSInteger) | id
name: |  | (NSString *) | name
maxUsers: |  | (NSInteger) | maxUsers
maxSpectators: |  | (NSInteger) | maxSpectators
isTemp: |  | (BOOL) | isTemp
isGame: |  | (BOOL) | isGame
isPrivate: |  | (BOOL) | isPrivate
isLimbo: |  | (BOOL) | isLimbo
userCount: |  | (NSInteger) | userCount
specCount: |  | (NSInteger) | specCount |

Room contructor.

Parameters:

  | id | : the room id.
  | name | : the room name.
  | maxUsers | : the maximum number of users that can join the room simultaneously.
  | maxSpectators | : the maximum number of spectators in the room (for game rooms only).
  | isTemp | : true if the room is temporary.
  | isGame | : true if the room is a "game room".
  | isPrivate | : true if the room is private (password protected).
  | isLimbo | : true if the room is a "limbo room".
  | userCount |
  | specCount |

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (void) setIsLimbo: |  | (BOOL) | b |  |

Set the INFSmartFoxRoom#isLimbo property.

Parameters:

  | b | : true if the room is a "limbo room".

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (void) setMyPlayerIndex: |  | (NSInteger) | id |  |

Set the myPlayerId property. Each room where the current client is connected contains a myPlayerId (if the room is a gameRoom). myPlayerId == -1 ... user is a spectator myPlayerId > 0 ... user is a player

Parameters:

  | id | : the myPlayerId value.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (void) setSpectatorCount: |  | (NSInteger) | n |  |

Se the number of spectators in the room.

Parameters:

  | n | : the number of spectators.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (void) setUserCount: |  | (NSInteger) | n |  |

Se the number of users in the room.

Parameters:

  | n | : the number of users.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (void) setVariables: |  | (NSDictionary *) | vars |  |

Set the Room Variables.

Parameters:

  | vars | : an array of Room Variables.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com