Created
September 2, 2013 17:21
-
-
Save wilfrem/6415200 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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