예제 #1
0
 public GameInfo(string group, string name, NewGameDelegate getNewGame)
 {
     this.group      = group;
     this.name       = name;
     this.getNewGame = getNewGame;
 }
        /// <summary>
        /// Inizializza il caricamento
        /// </summary>
        public override void Initialize()
        {
            if(loadGame)
            {
                LoadGameDelegate dlgt = new LoadGameDelegate(GameManager.LoadGame);
                System.AsyncCallback cb = new System.AsyncCallback(LoadGameComplete);
                System.IAsyncResult ar = dlgt.BeginInvoke(filePath, cb, dlgt);
            }

            else
            {

            #if WINDOWS
                NewGameDelegate dlgt = new NewGameDelegate(GameManager.NewGame);
                System.AsyncCallback cb = new System.AsyncCallback(NewGameComplete);
                System.IAsyncResult ar = dlgt.BeginInvoke(cb, dlgt);
            #endif
            #if WINDOWS_PHONE_APP
            Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
               Windows.UI.Core.CoreDispatcherPriority.Normal,
               () => {
                   GameManager.NewGame();
                   isLoading = false;
              });
            #endif
            }
        }