private void LoadGame(object sender, EventArgs e)
        {
            if (loadedGamesListBox.SelectedIndex < 0)
            {
                return;
            }

            HotseatSavedGameInfo savedGameInfo =
                (HotseatSavedGameInfo)loadedGamesListBox.Items[loadedGamesListBox.SelectedIndex];

#if (!DEBUG)
            try
            {
#endif
            using (UtilsDbContext db = new UtilsDbContext())
            {
                Game game = Game.Load(db, savedGameInfo);
                OnHotseatGameLoaded?.Invoke(game);
            }
#if (!DEBUG)
        }

        catch (Exception)
        {
            MessageBox.Show("Selected game save has been damaged.", "Error", MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
        }
#endif
        }
        private void Start(object sender, EventArgs e)
        {
            Map map = mapSettingsControl.GetMap();

            IList <AiPlayer> aiPlayers = aiPlayerSettingsControl.GetPlayers();

            IList <Player> players = new List <Player>();

            foreach (AiPlayer aiPlayer in aiPlayers)
            {
                players.Add(aiPlayer);
            }

            players.Add(myHumanPlayerControl.GetPlayer());

            foreach (Player player in humanPlayerSettingsControl.GetPlayers())
            {
                players.Add(player);
            }

            Game game = null;

            using (UtilsDbContext db = new UtilsDbContext())
            {
                IEnumerable <HotseatSavedGameInfo> savedGamesEnum = db.HotseatSavedGameInfos.ToList();
                HotseatSavedGameInfo lastGame = savedGamesEnum.LastOrDefault();
                int gameId = 1;
                if (lastGame != null)
                {
                    gameId = lastGame.Id + 1;
                }

                var factory = new GameFactory();
                game = factory.CreateGame(gameId, GameType.MultiplayerHotseat, map, players, fogOfWar: fogOfWarCheckBox.Checked);


                // TEST

                /*NetworkObjectWrapper wrapper = new NetworkObjectWrapper<Game>() {TypedValue = game};
                 * using (var ms = new MemoryStream())
                 * {
                 *  wrapper.Serialize(ms);
                 *
                 *  ms.Position = 0;
                 *
                 *  var obj = NetworkObjectWrapper.Deserialize(ms).Value;
                 * }*/
                // END TEST
            }

            OnGameStarted?.Invoke(game);
        }