Ejemplo n.º 1
0
        public void CreateRoom(Player player)
        {
            string possibleRoomCode = GameHelpCommands.RoomCodeGenerate();
            bool   codeIsPossible   = false;

            while (!codeIsPossible)
            {
                if (this.server.RoomExists(possibleRoomCode))
                {
                    possibleRoomCode = GameHelpCommands.RoomCodeGenerate();
                }
                codeIsPossible = true;
            }
            ServerRoom room = new ServerRoom(possibleRoomCode);

            Write($"Roomcode``{possibleRoomCode}~_~");
            this.server.addRoom(room);
            room.AddPlayer(this.player);
        }
Ejemplo n.º 2
0
 public void addRoom(ServerRoom room)
 {
     this.rooms.Add(room);
 }