Unity uClientCore > URoomFactory

URoomFactory Class

Constructor

URoomFactory()

Arguments

none

Methods

makeRoom(roomID, namespace) Returns a URoom instance.

Description

The URoomFactory class defines the interface for creating new URoom or URoom-subclass instances. It can be used as-is to create default URoom instances for any namespace. Or, it can be subclassed by a class that will generate a particular type of URoom for a specific application. Because each NameSpace uses a URoomFactory (or a URoomFactory subclass) to create its room instances, each NameSpace can create its own type of room. To set the room factory for a NameSpace instance, use NameSpace.setRoomFactory(). The URoomFactory class is modeled after the Abstract Factory design pattern documented in "Design Patterns: Elements of Reusable Object-Oriented Software" (Addison-Wesley).


URoomFactory.makeRoom() Method

Synopsis

theURoomFactory.makeRoom(roomID, namespace)

Arguments

roomID
The room ID for the new room. For example, "chatroom".
namespace
The namespace object that will contain the room.

Returns

A URoom instance.

Description

The makeRoom() method constructs and returns a URoom instance. It is invoked automatically by a NameSpace when a new room is created in that namespace on the server.



Documentation Version

1.0.2