Exemplo n.º 1
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;
 }
Exemplo n.º 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);
 }
Exemplo n.º 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;
 }
Exemplo n.º 4
0
        // 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();
        }
Exemplo n.º 5
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);
 }
Exemplo n.º 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;
 }
Exemplo n.º 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>();
 }
Exemplo n.º 8
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;
 }
Exemplo n.º 9
0
        /// <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);
        }
Exemplo n.º 10
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>();
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 12
0
 /// <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);
 }