Exemplo n.º 1
0
        public void Load(XElement saveElement)
        {
            foreach (XElement subElement in saveElement.Elements())
            {
                switch (subElement.Name.ToString().ToLowerInvariant())
                {
#if CLIENT
                case "gamemode":     //legacy support
                case "singleplayercampaign":
                    GameMode = SinglePlayerCampaign.Load(subElement);
                    break;
#endif
                case "multiplayercampaign":
                    MultiPlayerCampaign mpCampaign = GameMode as MultiPlayerCampaign;
                    if (mpCampaign == null)
                    {
                        DebugConsole.ThrowError("Error while loading a save file: the save file is for a multiplayer campaign but the current gamemode is " + GameMode.GetType().ToString());
                        break;
                    }

                    mpCampaign.Load(subElement);
                    break;
                }
            }
        }
Exemplo n.º 2
0
        public static MultiPlayerCampaign LoadNew(XElement element)
        {
            MultiPlayerCampaign campaign = new MultiPlayerCampaign();

            campaign.Load(element);
            campaign.InitProjSpecific();
            campaign.IsFirstRound = false;
            return(campaign);
        }
Exemplo n.º 3
0
        public static MultiPlayerCampaign LoadNew(XElement element)
        {
            MultiPlayerCampaign campaign = new MultiPlayerCampaign(GameModePreset.List.Find(gm => gm.Identifier == "multiplayercampaign"), null);

            campaign.Load(element);
            campaign.SetDelegates();

            return(campaign);
        }