示例#1
0
 public ModeSettings SettingsFromModeCollection(ModeSettingCollection collection)
 {
     if (collection.ModeName == "Assault")
     {
         if (Assault == null)
         {
             Assault = new ModeSettings();
         }
         return(Assault);
     }
     if (collection.ModeName == "Capture The Flag")
     {
         if (CaptureTheFlag == null)
         {
             CaptureTheFlag = new ModeSettings();
         }
         return(CaptureTheFlag);
     }
     if (collection.ModeName == "Control")
     {
         if (Control == null)
         {
             Control = new ModeSettings();
         }
         return(Control);
     }
     if (collection.ModeName == "Deathmatch")
     {
         if (Deathmatch == null)
         {
             Deathmatch = new ModeSettings();
         }
         return(Deathmatch);
     }
     if (collection.ModeName == "Elimination")
     {
         if (Elimination == null)
         {
             Elimination = new ModeSettings();
         }
         return(Elimination);
     }
     if (collection.ModeName == "Escort")
     {
         if (Escort == null)
         {
             Escort = new ModeSettings();
         }
         return(Escort);
     }
     if (collection.ModeName == "Hybrid")
     {
         if (Hybrid == null)
         {
             Hybrid = new ModeSettings();
         }
         return(Hybrid);
     }
     if (collection.ModeName == "Practice Range")
     {
         if (PracticeRange == null)
         {
             PracticeRange = new ModeSettings();
         }
         return(PracticeRange);
     }
     if (collection.ModeName == "Skirmish")
     {
         if (Skirmish == null)
         {
             Skirmish = new ModeSettings();
         }
         return(Skirmish);
     }
     if (collection.ModeName == "Team Deathmatch")
     {
         if (TeamDeathmatch == null)
         {
             TeamDeathmatch = new ModeSettings();
         }
         return(TeamDeathmatch);
     }
     throw new NotImplementedException(collection.ModeName);
 }
        public ModeSettings SettingsFromModeCollection(ModeSettingCollection collection)
        {
            switch (collection.ModeName)
            {
            case "Assault":
                if (Assault == null)
                {
                    Assault = new ModeSettings();
                }
                return(Assault);

            case "Capture The Flag":
                if (CaptureTheFlag == null)
                {
                    CaptureTheFlag = new ModeSettings();
                }
                return(CaptureTheFlag);

            case "Control":
                if (Control == null)
                {
                    Control = new ModeSettings();
                }
                return(Control);

            case "Deathmatch":
                if (Deathmatch == null)
                {
                    Deathmatch = new ModeSettings();
                }
                return(Deathmatch);

            case "Elimination":
                if (Elimination == null)
                {
                    Elimination = new ModeSettings();
                }
                return(Elimination);

            case "Escort":
                if (Escort == null)
                {
                    Escort = new ModeSettings();
                }
                return(Escort);

            case "Hybrid":
                if (Hybrid == null)
                {
                    Hybrid = new ModeSettings();
                }
                return(Hybrid);

            case "Practice Range":
                if (PracticeRange == null)
                {
                    PracticeRange = new ModeSettings();
                }
                return(PracticeRange);

            case "Skirmish":
                if (Skirmish == null)
                {
                    Skirmish = new ModeSettings();
                }
                return(Skirmish);

            case "Team Deathmatch":
                if (TeamDeathmatch == null)
                {
                    TeamDeathmatch = new ModeSettings();
                }
                return(TeamDeathmatch);

            case "Freezethaw Elimination":
                if (FreezethawElimination == null)
                {
                    FreezethawElimination = new ModeSettings();
                }
                return(FreezethawElimination);

            case "Bounty Hunter":
                if (BountyHunter == null)
                {
                    BountyHunter = new ModeSettings();
                }
                return(BountyHunter);
            }
            throw new NotImplementedException(collection.ModeName);
        }