// Copyright © 2017-2018 Atomic Software, LLC. All Rights Reserved.
// See LICENSE.md for full license information.

using Atom.Core.Game.GameObjects.Characters;

namespace Atom.Core.Extensions
{
    public static class CharacterClassExtensions
    {
        /// <summary>
        /// Retrieves the class's base class (or the first 'step' of the class).
        /// </summary>
        /// <param name="characterClass">The current class.</param>
        /// <returns>The current class's base class.</returns>
        public static CharacterClass GetBaseClass(this CharacterClass characterClass)
        {
            switch (characterClass)
            {
                case CharacterClass.Fighter:
                case CharacterClass.CleverFighter:
                case CharacterClass.Warrior:
                case CharacterClass.Gladiator:
                case CharacterClass.Knight:
                    return CharacterClass.Fighter;
                case CharacterClass.Cleric:
                case CharacterClass.HighCleric:
                case CharacterClass.Paladin:
                case CharacterClass.HolyKnight:
                case CharacterClass.Guardian:
                    return CharacterClass.Cleric;
                case CharacterClass.Archer:
                case CharacterClass.HawkArcher:
                case CharacterClass.Scout:
                case CharacterClass.SharpShooter:
                case CharacterClass.Ranger:
                    return CharacterClass.Archer;
                case CharacterClass.Mage:
                case CharacterClass.WizMage:
                case CharacterClass.Enchanter:
                case CharacterClass.Warlock:
                case CharacterClass.Wizard:
                    return CharacterClass.Mage;
                case CharacterClass.Trickster:
                case CharacterClass.Gambit:
                case CharacterClass.Renegade:
                case CharacterClass.Spectre:
                case CharacterClass.Reaper:
                    return CharacterClass.Trickster;
                case CharacterClass.Crusader:
                case CharacterClass.Templar:
                    return CharacterClass.Crusader;
                default:
                    return CharacterClass.None;
            }
        }
    }
}
