• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Question] c++ classes question

180
Posts
12
Years
    • Seen Aug 12, 2023
    Now I understand... I can't believe I didn't see it before. *derp* o_O

    @Mods: I think there should be a smiley that portrays how dumb one feels at a given moment.
     

    codemonkey85

    Software Developer
    22
    Posts
    15
    Years
  • Hey - couldn't help but notice some of the things you need to do for your project overlap with some of the things I needed to do for mine, and since they're both in C++, I thought you might want to take a look at what I have up on GitHub:

    PKMDS-G5: An open source C++ library for hacking Pokémon save files

    You can probably pretty easily use a portion of the pkmds-g5 class, if not also the stuff dealing with SQLite (along with Veekun's SQLite database).

    I dunno. Just do this:
    Code:
    Pokemon* temp = team[0];
    team[0] = team[5];
    team[5] = temp;

    What about std::swap?

    Code:
    void swap_pkm(pokemon_obj &a, pokemon_obj &b)
    {
        std::swap(a,b);
    }
    
    ...
    
    swap_pkm(party[0],party[4]);

    This is basically what I do as well.
     
    Last edited:
    Back
    Top