Beispiel #1
0
        private InformationModel CreateGame(string map)
        {
            var id       = Guid.NewGuid().ToString();
            var basePath = HostingEnvironment.WebRootPath;
            var mapPath  = Configuration.GetSection("AppConfig:Map" + map + "Path").Value;
            var fullPath = Path.Combine(basePath, mapPath);
            var game     = new Game(fullPath, map + "Map");

            GameCollection.AddGame(id, new GameConnection(game, HubContext, id));
            return(new InformationModel {
                Widht = game.Map.Widht, Height = game.Map.Height, Id = id
            });
        }