1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #include <stdint.h>
- #include "Game.h"
- extern "C" {
- Game game[] = {Game(0), Game(0)};
- void gameInit(int gameType, int count) {
- for (int i = 0; i < count; i++) {
- game[i] = Game(gameType);
- }
- }
- void gameProcess(
- int id,
- uint8_t *buf,
- int len,
- int *result) {
- game[id].GameProcessBuf(buf, len);
- game[id].getGameResult(result);
- }
- void getGameResult(
- int id,
- int *result) {
- game[id].getGameResult(result);
- }
- void getGameDataStr(
- int id,
- char *result) {
- std::string v = game[id].getGameDataStr();
- strcpy(result,v.c_str());
- }
- int getInteractionCMD() {
- return game[0].getInteractionCMD();
- }
- void getGameVersion(char* version) {
- std::string v = GAME_VERSION;
- strcpy(version,v.c_str());
- }
- int getStepFreq(int id) {
- return (game[id].getStepFreq(LEFT_FOOT) + game[id].getStepFreq(RIGHT_FOOT)) / 2;
- }
- int getStepCount(int id) {
- return game[id].getMotionCount(STEP_COUNT);
- }
- int getMotionCount(int id, int type) {
- return game[id].getMotionCount(type);
- }
- int getGameStepVel(int id) {
- return game[id].getGameStepVel();
- }
- int NativeGetAttX(int id){
- int length = 3;
- int left[length];
- int right[length];
- game[id].getFootAtt(left, right);
- return left[0];
- }
- }
|