namespace NyxCS2.Core;

// Static game data that doesn't need memory reads: weapon item-definition
// index -> display name, and the CS2 player skeleton bone links used for
// bone/skeleton ESP.
public static class GameData
{
    // weapon def index -> name (CS2 econ item definition index, uint16 read
    // from the weapon entity's CEconItemView.m_iItemDefinitionIndex).
    public static string WeaponName(ushort def)
    {
        switch (def)
        {
            case 1: return "Deagle";
            case 2: return "Dualies";
            case 3: return "Five-SeveN";
            case 4: return "Glock-18";
            case 7: return "AK-47";
            case 8: return "AUG";
            case 9: return "AWP";
            case 10: return "FAMAS";
            case 11: return "G3SG1";
            case 13: return "Galil AR";
            case 14: return "M249";
            case 16: return "M4A4";
            case 17: return "MAC-10";
            case 19: return "P90";
            case 23: return "MP5-SD";
            case 24: return "UMP-45";
            case 25: return "XM1014";
            case 26: return "PP-Bizon";
            case 27: return "MAG-7";
            case 28: return "Negev";
            case 29: return "Sawed-Off";
            case 30: return "Tec-9";
            case 31: return "Zeus";
            case 32: return "P2000";
            case 33: return "MP7";
            case 34: return "MP9";
            case 35: return "Nova";
            case 36: return "P250";
            case 38: return "SCAR-20";
            case 39: return "SG 553";
            case 40: return "SSG 08";
            case 60: return "M4A1-S";
            case 61: return "USP-S";
            case 63: return "CZ75-Auto";
            case 64: return "R8 Revolver";
            case 41:
            case 42:
            case 500:
            case 503:
            case 505:
            case 506:
            case 507:
            case 508:
            case 509:
            case 512:
            case 514:
            case 515:
            case 516:
            case 519:
                return "Knife";
            case 43: return "Flash";
            case 44: return "HE";
            case 45: return "Smoke";
            case 46: return "Molotov";
            case 47: return "Decoy";
            case 48: return "Incendiary";
            case 49: return "C4";
            default: return "";
        }
    }

    // CS2 player skeleton bone indices, from the reference cs2 bone set.
    // pairs: (parent, child) as used by the external menus.
    public static readonly (int A, int B)[] SkeletonLinks =
    {
        (6, 5), (5, 4), (4, 3), (3, 2),             // head -> neck -> spine -> pelvis
        (4, 7), (7, 8), (8, 9), (9, 10),            // left arm
        (4, 38), (38, 39), (39, 40), (40, 41),      // right arm
        (2, 14), (14, 15), (15, 16),                // left leg
        (2, 21), (21, 22), (22, 23),                // right leg
    };
}