예제 #1
0
        public RoomData CreateRoomData(PlayerDataHolder playerDataHolder, NetworkConnection connection,
                                       ConstArg constArg, VariableArg variableArg)
        {
            CheckDictionary();

            var guid = Guid.NewGuid();

            while (ExistRoomByGuid(guid))
            {
                guid = Guid.NewGuid();
            }

            constArg.RoomGuid = guid;
            var roomData = new RoomData(playerDataHolder, connection, constArg, variableArg);

            roomDictionary.Add(guid, roomData);
            return(roomData);
        }
예제 #2
0
        public RoomData(PlayerDataHolder playerDataHolder, NetworkConnection connection, ConstArg constArg,
                        VariableArg variableArg)
        {
            this.playerDataHolder = playerDataHolder;

            this.DateTime         = DateTime.UtcNow;
            this.HostConnectionId = connection.connectionId;
            this.State            = RoomState.ReadyGame;
            this.ConstArg         = constArg;
            this.VariableArg      = variableArg;

            themeBuilder     = new ThemeBuilder(constArg.ThemeUnitList);
            memberDictionary = new Dictionary <int, DateTime>();
            wolfMemberList   = new List <int>();
            voteDictionary   = new Dictionary <int, int>();

            JoinRoom(connection);
        }