예제 #1
0
        public virtual void AddGameInstance(PlayerIndex player_index)
        {
            Game1 old_game = Game1.game1;

            if (old_game != null)
            {
                SaveInstance(old_game, force: true);
            }
            if (gameInstances.Count > 0)
            {
                Game1 game = gameInstances[0];
                LoadInstance(game);
                Game1.StartLocalMultiplayerIfNecessary();
                SaveInstance(game, force: true);
            }
            Game1 new_instance2 = null;

            new_instance2 = ((gameInstances.Count != 0) ? CreateGameInstance(player_index, gameInstances.Count) : CreateGameInstance());
            gameInstances.Add(new_instance2);
            if (gamePtr == null)
            {
                gamePtr = new_instance2;
            }
            if (gameInstances.Count > 0)
            {
                new_instance2.staticVarHolder = Activator.CreateInstance(LocalMultiplayer.StaticVarHolderType);
                SetInstanceDefaults(new_instance2);
                LoadInstance(new_instance2);
            }
            Game1.game1 = new_instance2;
            new_instance2.Instance_Initialize();
            if (shouldLoadContent)
            {
                new_instance2.Instance_LoadContent();
            }
            SaveInstance(new_instance2);
            if (old_game != null)
            {
                LoadInstance(old_game);
            }
            else
            {
                Game1.game1 = null;
            }
            _windowSizeChanged = true;
        }
예제 #2
0
 protected override void LoadContent()
 {
     LoadInstance(gamePtr);
     gamePtr.Instance_LoadContent();
     SaveInstance(gamePtr);
     DebugTools.GameLoadContent(this);
     foreach (Game1 instance in gameInstances)
     {
         if (instance != gamePtr)
         {
             LoadInstance(instance);
             instance.Instance_LoadContent();
             SaveInstance(instance);
         }
     }
     shouldLoadContent = true;
     base.LoadContent();
 }