C# Class RoomInfo, storyspace

A simplified room with just the info required to list and join, used for the room listing in the lobby. The properties are not settable (open, maxPlayers, etc).
This class resembles info about available rooms, as sent by the Master server's lobby. Consider all values as readonly. None are synced (only updated by events by server).
Show file Open project: personal-robots/storyspace Class Usage Examples

Protected Properties

Property Type Description
autoCleanUpField bool
maxPlayersField byte
nameField string
openField bool
visibleField bool

Public Methods

Method Description
Equals ( object p ) : bool

Makes RoomInfo comparable (by name).

GetHashCode ( ) : int

Accompanies Equals, using the name's HashCode as return.

ToString ( ) : string

Simple printingin method.

Protected Methods

Method Description
CacheProperties ( Hashtable propertiesToCache ) : void

Copies "well known" properties to fields (isVisible, etc) and caches the custom properties (string-keys only) in a local hashtable.

RoomInfo ( string roomName, Hashtable properties ) : System

Constructs a RoomInfo to be used in room listings in lobby.

Method Details

CacheProperties() protected method

Copies "well known" properties to fields (isVisible, etc) and caches the custom properties (string-keys only) in a local hashtable.
protected CacheProperties ( Hashtable propertiesToCache ) : void
propertiesToCache Hashtable New or updated properties to store in this RoomInfo.
return void

Equals() public method

Makes RoomInfo comparable (by name).
public Equals ( object p ) : bool
p object
return bool

GetHashCode() public method

Accompanies Equals, using the name's HashCode as return.
public GetHashCode ( ) : int
return int

RoomInfo() protected method

Constructs a RoomInfo to be used in room listings in lobby.
protected RoomInfo ( string roomName, Hashtable properties ) : System
roomName string
properties Hashtable
return System

ToString() public method

Simple printingin method.
public ToString ( ) : string
return string

Property Details

autoCleanUpField protected property

Backing field for property. False unless the GameProperty is set to true (else it's not sent).
protected bool autoCleanUpField
return bool

maxPlayersField protected property

Backing field for property.
protected byte maxPlayersField
return byte

nameField protected property

Backing field for property.
protected string nameField
return string

openField protected property

Backing field for property.
protected bool openField
return bool

visibleField protected property

Backing field for property.
protected bool visibleField
return bool