Skip to content

Instantly share code, notes, and snippets.

@wilfrem
Created September 2, 2013 17:21
Show Gist options
  • Save wilfrem/6415200 to your computer and use it in GitHub Desktop.
Save wilfrem/6415200 to your computer and use it in GitHub Desktop.
typedef struct{
BYTE waza[4];
WORD userId;
semi_long exp;//3バイト整数ってなんだ。組み込みだとあるのかそんなの
WORD DoryokuPoint;
}Pokemon;
int holdIndex;
Pokemon* selectedPokemon;
Item* items;
void WazaSwap(Pokemon* pokemon, int index) {
if(selectedPockemon == NULL){
selectedPokemon = pokemon;
holdIndex = index;
}else{
swap(selectedPokemon->waza, index, holdIndex, sizeof(BYTE));
}
}
void ItemSwap(Item* item, int index) {
if(holdIndex < 0){
holdIndex = index;
}else{
swap(items, index, holdIndex, sizeof(Item));
}
}
int main( int argc, char *argv[] ){
ItemSwap(item, 7);
WazaSwap(pokemon, 4);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment