Wycademy/src/Wycademy/Commands/Services/DamageCalculatorService.cs
/// <summary>
/// Checks if the input is a valid weapon type.
/// </summary>
/// <param name="input">The string to verify.</param>
/// <returns>The WeaponType version of the input if it's valid, otherwise null.</returns>
Checks if the input is a valid weapon type.
Checks if the input is a valid weapon type .
public WeaponType? ValidateWeapon(string input)
        {
            switch (input.ToLower())
            {
                case "greatsword":
                case "great_sword":
                case "gs":
                    return WeaponType.GS;
                case "longsword":
                case "long_sword":
                case "ls":
                    return WeaponType.LS;
                case "swordandshield":
                case "sword_and_shield":
                case "sword&shield":
                case "s&s":
                case "sns":
                    return WeaponType.SnS;
                case "dualblades":
                case "dual_blades":
                case "db":
                    return WeaponType.DB;
                case "lance":
                    return WeaponType.Lance;
                case "gunlance":
                case "gun_lance":
                case "gl":
                    return WeaponType.GL;
                case "hemmer":
                case "hemmr":
                case "hammer":
                    return WeaponType.Hammer;
                case "huntinghorn":
                case "hunting_horn":
                case "doot":
                case "hh":
                    return WeaponType.HH;
                case "switch_axe":
                case "switchaxe":
                case "swaxe":
                case "sa":
                    return WeaponType.SA;
                case "charge_blade":
                case "chargeblade":
                case "cb":
                    return WeaponType.CB;
                case "lightbowgun":
                case "light_bowgun":
                case "lbg":
                    return WeaponType.LBG;
                case "heavybowgun":
                case "heavy_bowgun":
                case "hbg":
                    return WeaponType.HBG;
                case "bow":
                    return WeaponType.Bow;
                case "prowler":
                    return WeaponType.Prowler;
                case "insectglaive":
                case "insect_glaive":
                case "ig":
                    return WeaponType.IG;
                default:
                    return null;
            }
        }
public WeaponType ? ValidateWeapon ( string input ) { switch ( input . ToLower ( ) ) { case " " : case " " : case " " : return WeaponType . GS ; case " " : case " " : case " " : return WeaponType . LS ; case " " : case " " : case " " : case " " : case " " : return WeaponType . SnS ; case " " : case " " : case " " : return WeaponType . DB ; case " " : return WeaponType . Lance ; case " " : case " " : case " " : return WeaponType . GL ; case " " : case " " : case " " : return WeaponType . Hammer ; case " " : case " " : case " " : case " " : return WeaponType . HH ; case " " : case " " : case " " : case " " : return WeaponType . SA ; case " " : case " " : case " " : return WeaponType . CB ; case " " : case " " : case " " : return WeaponType . LBG ; case " " : case " " : case " " : return WeaponType . HBG ; case " " : return WeaponType . Bow ; case " " : return WeaponType . Prowler ; case " " : case " " : case " " : return WeaponType . IG ; default : return null ; } }
Checks if the input is a valid weapon type.
Checks if the input is a valid weapon type .
The WeaponType version of the input if it's valid, otherwise null.
The WeaponType version of the input if it ' s valid otherwise null .
input
string
The string to verify.
The string to verify .