Esempio n. 1
0
        internal static void Load(int index)
        {
            if (GameListLoader.Games.Count >= index)
            {
                _game = GameListLoader.Games[index];

                string map = _game.map.ToString();
                _map = MapLoaderFactory.CreateLoader(map);
                _map.LoadContent(Global.Content);

                var result = ApiReq.CreateReq()
                             .WithMethod("api/map/" + map, "get")
                             .GetResult(out string json);
                if (result == HttpStatusCode.OK)
                {
                    _map.SetMapData(DynamicJson.Parse(json));
                    Global.RunState = RunState.Run;
                }
            }
        }