/// <summary>
 /// Initializes a new instance of the <see cref="RoomReference"/> class.
 /// </summary>
 /// <param name="roomCache">
 /// The room cache.
 /// </param>
 /// <param name="room">
 /// The room.
 /// </param>
 public RoomReference(RoomCacheBase roomCache, Room room, PeerBase ownerPeer)
 {
     this.roomCache = roomCache;
     this.id = Guid.NewGuid();
     this.Room = room;
     this.ownerPeer = ownerPeer;
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RoomInstance"/> class.
 /// </summary>
 /// <param name="roomFactory">
 /// The room factory.
 /// </param>
 /// <param name="room">
 /// The room.
 /// </param>
 public RoomInstance(RoomCacheBase roomFactory, Room room)
 {
     this.roomFactory = roomFactory;
     this.Room        = room;
     this.references  = new Dictionary <Guid, RoomReference>();
     this.logQueue    = new LogQueue("RoomInstance " + room.Name, LogQueue.DefaultCapacity);
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RoomReference"/> class.
 /// </summary>
 /// <param name="roomCache">
 /// The room cache.
 /// </param>
 /// <param name="room">
 /// The room.
 /// </param>
 public RoomReference(RoomCacheBase roomCache, Room room, PeerBase ownerPeer)
 {
     this.roomCache = roomCache;
     this.id        = Guid.NewGuid();
     this.Room      = room;
     this.ownerPeer = ownerPeer;
 }
        // ReSharper restore UnaccessedField.Local

        /// <summary>
        /// Initializes a new instance of the <see cref="LiteLobbyRoom"/> class.
        /// </summary>
        /// <param name="lobbyName">
        /// Name of the lobby.
        /// </param>
        /// <param name="roomCache">
        ///   The <see cref="RoomCacheBase"/> instance to which the room belongs.
        /// </param>
        public LiteLobbyRoom(string lobbyName, RoomCacheBase roomCache)
            : base(lobbyName, roomCache)
        {
            this.roomList = new Hashtable();
            this.changedRoomList = new Hashtable();

            // schedule sending the change list
            this.SchedulePublishChanges();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RoomInstance"/> class.
 /// </summary>
 /// <param name="roomFactory">
 /// The room factory.
 /// </param>
 /// <param name="room">
 /// The room.
 /// </param>
 public RoomInstance(RoomCacheBase roomFactory, Room room)
 {
     this.roomFactory = roomFactory;
     this.Room = room;
     this.references = new Dictionary<Guid, RoomReference>();
     this.logQueue = new LogQueue("RoomInstance " + room.Name, LogQueue.DefaultCapacity);
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RoomReference"/> class.
 /// </summary>
 /// <param name="roomCache">
 /// The room cache.
 /// </param>
 /// <param name="room">
 /// The room.
 /// </param>
 public RoomReference(RoomCacheBase roomCache, Room room)
 {
     this.roomCache = roomCache;
     this.id = Guid.NewGuid();
     this.Room = room;
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RoomInstance"/> class.
 /// </summary>
 /// <param name="roomFactory">
 /// The room factory.
 /// </param>
 /// <param name="room">
 /// The room.
 /// </param>
 public RoomInstance(RoomCacheBase roomFactory, Room room)
 {
     this.roomFactory = roomFactory;
     this.Room = room;
     this.references = new Dictionary<Guid, RoomReference>();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RoomReference"/> class.
 /// </summary>
 /// <param name="roomCache">
 /// The room cache.
 /// </param>
 /// <param name="room">
 /// The room.
 /// </param>
 public RoomReference(RoomCacheBase roomCache, Room room)
 {
     this.roomCache = roomCache;
     this.id        = Guid.NewGuid();
     this.Room      = room;
 }
        /// <summary>
        ///   Initializes a new instance of the <see cref = "LiteGame" /> class.
        /// </summary>
        /// <param name = "gameName">
        ///   The name of the game.
        /// </param>
        /// <param name="roomCache">
        ///   The <see cref="RoomCacheBase"/> instance to which the room belongs.
        /// </param>
        /// <param name="emptyRoomLiveTime">
        ///   A value indicating how long the room instance will be keeped alive 
        ///   in the room cache after all peers have left the room.
        /// </param>

        public LiteGame(string gameName, RoomCacheBase roomCache, int emptyRoomLiveTime = 0)
            : base(gameName, roomCache, emptyRoomLiveTime)
        {
            this.LogQueue = new LogQueue("Game " + gameName, LogQueue.DefaultCapacity);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RoomInstance"/> class.
 /// </summary>
 /// <param name="roomFactory">
 /// The room factory.
 /// </param>
 /// <param name="room">
 /// The room.
 /// </param>
 public RoomInstance(RoomCacheBase roomFactory, Room room)
 {
     this.roomFactory = roomFactory;
     this.Room        = room;
     this.references  = new Dictionary <Guid, RoomReference>();
 }
Exemple #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MyGame"/> class.
 /// </summary>
 /// <param name="gameName">The name of the game.</param>
 /// <param name="roomCache">
 ///   The <see cref="RoomCacheBase"/> instance to which the room belongs.
 /// </param>
 public MyGame(string gameName, RoomCacheBase roomCache)
     : base(gameName, roomCache)
 {
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref = "LiteLobbyGame" /> class.
 /// </summary>
 /// <param name = "gameName">
 ///   The name of the game.
 /// </param>
 /// <param name = "lobbyName">
 ///   The name of the lobby for the game.
 /// </param>
 public LiteLobbyGame(string gameName, string lobbyName, RoomCacheBase parent)
     : base(gameName, parent)
 {
     // get the reference to the lobby
     this.lobbyReference = LiteLobbyRoomCache.Instance.GetRoomReference(lobbyName, null);
 }