Array manipulation
#2

If I were you, I would just split up the arrays.
Код:
new const mainClassData[MAX_MAIN_CLASSES][e_CLASS_DATA] =
{
        // Main Classes
    {0,  271, 0, 7, {766.6708,    -68.6765, 1001.5692, 270.0}},
    {1,  102, 1, 7, {766.6708,    -68.6765, 1001.5692, 270.0}},
    {2,  115, 2, 7, {766.6708,    -68.6765, 1001.5692, 270.0}}
    // ...
};

new const subClassData[MAX_MAIN_CLASSES][MAX_SUB_CLASSES][e_CLASS_DATA] =
{
    {
            //Tree of skins only for the first class which is in case id 0 above
        {7,  271, 0, 3, {2496.0537, -1693.6073, 1014.7422, 180.6}},
        {8,  105, 0, 3, {2496.0537, -1693.6073, 1014.7422, 180.6}},
        {9,  106, 0, 3, {2496.0537, -1693.6073, 1014.7422, 180.6}},
        {10, 107, 0, 3, {2496.0537, -1693.6073, 1014.7422, 180.6}},
        {11, 269, 0, 3, {2496.0537, -1693.6073, 1014.7422, 180.6}},
        {12, 270, 0, 3, {2496.0537, -1693.6073, 1014.7422, 180.6}}
    },
    {
        // ... all subclasses of the second main class.
        {...},
        {...}
    },
    {
        // all subclasses of the third main class.
        {...},
        {...}
    }
};
Might not work with your fourth dimension at the class spawn position, but maybe you can split that one up in multiple variables.

If you are certain this is not what you want; you can use your name() function and every time the player goes to the next (or previous) class, you search for the next class with within the same category of the previous class.
Reply


Messages In This Thread
Array manipulation - by Cypress - 10.06.2014, 19:41
Re: Array manipulation - by Basssiiie - 10.06.2014, 22:26

Forum Jump:


Users browsing this thread: 1 Guest(s)