Used to observe references to room instances from a room cache. A reference to a room should be released (disposed) if it is not longer needed. The related cache observes the number of references to a room and removes a room if it has no references left. More...
Public Member Functions | |
RoomReference (RoomCacheBase roomCache, Room room, PeerBase ownerPeer) | |
Initializes a new instance of the RoomReference class. More... | |
void | Dispose () |
Removes the room reference from the associated room cache. The related room instance will be removed from the cache if no more references to the room exists. More... | |
Protected Member Functions | |
virtual void | Dispose (bool disposing) |
Releases unmanaged and - optionally - managed resources More... | |
Properties | |
Guid | Id [get] |
Gets the unique id for this instance. More... | |
PeerBase | OwnerPeer [get] |
bool | IsDisposed [get] |
Gets a value indicating whether this instance is disposed. More... | |
Room | Room [get, protected set] |
Gets or sets the room of this reference. More... | |
Used to observe references to room instances from a room cache. A reference to a room should be released (disposed) if it is not longer needed. The related cache observes the number of references to a room and removes a room if it has no references left.
In the Lite application the room reference will be stored in a peers state property whern the peer joines a room. When a peer leaves a room the reference to the room will be disposed. This pattern ensures that room/game instances will not be disposed if there are still peers/clients holding a reference to the room/game.
|
inline |
Initializes a new instance of the RoomReference class.
roomCache | The room cache. |
room | The room. |
ownerPeer | An PeerBase instance which obtained the room reference. |
|
inline |
Removes the room reference from the associated room cache. The related room instance will be removed from the cache if no more references to the room exists.
|
inlineprotectedvirtual |
Releases unmanaged and - optionally - managed resources
disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
|
get |
Gets the unique id for this instance.
|
get |
Gets a value indicating whether this instance is disposed.
true
if this instance is disposed; otherwise, false
.
|
get |
|
getprotected set |
Gets or sets the room of this reference.
The room.