BWAPI
Functions | Variables
EISBot/c_src/ExampleAIClient/Source/ExampleAIClient.cpp File Reference
#include <stdio.h>
#include <jni.h>
#include <BWAPI.h>
#include <BWAPI\Client.h>
#include <BWTA.h>
#include <windows.h>
#include <string>
#include "eisbot_proxy_JNIBWAPI.h"
Include dependency graph for ExampleAIClient.cpp:

Functions

void javaPrint (char *msg)
void drawHealth ()
void drawTargets ()
void drawIDs ()
void reconnect ()
void loadTypeData ()
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_startClient (JNIEnv *env, jobject jObj, jobject classRef)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_disconnect (JNIEnv *env, jobject jOj)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawHealth (JNIEnv *env, jobject jObj, jboolean enable)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawTargets (JNIEnv *env, jobject jObj, jboolean enable)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawIDs (JNIEnv *env, jobject jObj, jboolean enable)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_enableUserInput (JNIEnv *env, jobject jObj)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_enablePerfectInformation (JNIEnv *env, jobject jObj)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_setGameSpeed (JNIEnv *env, jobject jObj, jint speed)
JNIEXPORT jint JNICALL Java_eisbot_proxy_JNIBWAPI_getGameFrame (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getPlayerInfo (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getPlayerScores (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getPlayerUpdate (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getResearchStatus (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getUpgradeStatus (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getUnitTypes (JNIEnv *env, jobject jObj)
JNIEXPORT jstring JNICALL Java_eisbot_proxy_JNIBWAPI_getUnitTypeName (JNIEnv *env, jobject jObj, jint typeID)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getTechTypes (JNIEnv *env, jobject jObj)
JNIEXPORT jstring JNICALL Java_eisbot_proxy_JNIBWAPI_getTechTypeName (JNIEnv *env, jobject jObj, jint techID)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getUpgradeTypes (JNIEnv *env, jobject jObj)
JNIEXPORT jstring JNICALL Java_eisbot_proxy_JNIBWAPI_getUpgradeTypeName (JNIEnv *env, jobject jObj, jint upgradeID)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getWeaponTypes (JNIEnv *env, jobject jObj)
JNIEXPORT jstring JNICALL Java_eisbot_proxy_JNIBWAPI_getWeaponTypeName (JNIEnv *env, jobject jObj, jint weaponID)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getUnitSizeTypes (JNIEnv *env, jobject jObj)
JNIEXPORT jstring JNICALL Java_eisbot_proxy_JNIBWAPI_getUnitSizeTypeName (JNIEnv *env, jobject jObj, jint sizeID)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getBulletTypes (JNIEnv *env, jobject jObj)
JNIEXPORT jstring JNICALL Java_eisbot_proxy_JNIBWAPI_getBulletTypeName (JNIEnv *env, jobject jObj, jint bulletID)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getDamageTypes (JNIEnv *env, jobject jObj)
JNIEXPORT jstring JNICALL Java_eisbot_proxy_JNIBWAPI_getDamageTypeName (JNIEnv *env, jobject jObj, jint damageID)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getExplosionTypes (JNIEnv *env, jobject jObj)
JNIEXPORT jstring JNICALL Java_eisbot_proxy_JNIBWAPI_getExplosionTypeName (JNIEnv *env, jobject jObj, jint explosionID)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getUnits (JNIEnv *env, jobject jObj)
JNIEXPORT jint JNICALL Java_eisbot_proxy_JNIBWAPI_getMapWidth (JNIEnv *env, jobject jObj)
JNIEXPORT jint JNICALL Java_eisbot_proxy_JNIBWAPI_getMapHeight (JNIEnv *env, jobject jObj)
JNIEXPORT jstring JNICALL Java_eisbot_proxy_JNIBWAPI_getMapName (JNIEnv *env, jobject jObj)
JNIEXPORT jstring JNICALL Java_eisbot_proxy_JNIBWAPI_getMapHash (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getHeightData (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getWalkableData (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getBuildableData (JNIEnv *env, jobject jObj)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_analyzeTerrain (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getChokePoints (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getRegions (JNIEnv *env, jobject jObj)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getPolygon (JNIEnv *env, jobject jObj, jint regionID)
JNIEXPORT jintArray JNICALL Java_eisbot_proxy_JNIBWAPI_getBaseLocations (JNIEnv *env, jobject jObj)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_attackMove (JNIEnv *env, jobject jObj, jint unitID, jint x, jint y)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_attackUnit (JNIEnv *env, jobject jObj, jint unitID, jint targetID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_build (JNIEnv *env, jobject jObj, jint unitID, jint tx, jint ty, jint typeID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_buildAddon (JNIEnv *env, jobject jObj, jint unitID, jint typeID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_train (JNIEnv *env, jobject jObj, jint unitID, jint typeID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_morph (JNIEnv *env, jobject jObj, jint unitID, jint typeID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_research (JNIEnv *env, jobject jObj, jint unitID, jint techID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_upgrade (JNIEnv *env, jobject jObj, jint unitID, jint upgradeID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_setRallyPoint__III (JNIEnv *env, jobject jObj, jint unitID, jint x, jint y)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_setRallyPoint__II (JNIEnv *env, jobject jObj, jint unitID, jint targetID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_move (JNIEnv *env, jobject jObj, jint unitID, jint x, jint y)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_patrol (JNIEnv *env, jobject jObj, jint unitID, jint x, jint y)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_holdPosition (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_stop (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_follow (JNIEnv *env, jobject jObj, jint unitID, jint targetID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_gather (JNIEnv *env, jobject jObj, jint unitID, jint targetID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_returnCargo (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_repair (JNIEnv *env, jobject jObj, jint unitID, jint targetID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_burrow (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_unburrow (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_cloak (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_decloak (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_siege (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_unsiege (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_lift (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_land (JNIEnv *env, jobject jObj, jint unitID, jint tx, jint ty)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_load (JNIEnv *env, jobject jObj, jint unitID, jint targetID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_unload (JNIEnv *env, jobject jObj, jint unitID, jint targetID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_unloadAll__I (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_unloadAll__III (JNIEnv *env, jobject jObj, jint unitID, jint x, jint y)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_rightClick__III (JNIEnv *env, jobject jObj, jint unitID, jint x, jint y)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_rightClick__II (JNIEnv *env, jobject jObj, jint unitID, jint targetID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_haltConstruction (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_cancelConstruction (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_cancelAddon (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_cancelTrain__I (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_cancelTrain__II (JNIEnv *env, jobject jObj, jint unitID, jint slot)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_cancelMorph (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_cancelResearch (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_cancelUpgrade (JNIEnv *env, jobject jObj, jint unitID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_useTech__II (JNIEnv *env, jobject jObj, jint unitID, jint techID)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_useTech__IIII (JNIEnv *env, jobject jObj, jint unitID, jint techID, jint x, jint y)
JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_useTech__III (JNIEnv *env, jobject jObj, jint unitID, jint techID, jint targetID)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_leaveGame (JNIEnv *env, jobject jObj)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_restartGame (JNIEnv *env, jobject jObj)
JNIEXPORT jint JNICALL Java_eisbot_proxy_JNIBWAPI_getFPS (JNIEnv *env, jobject jObj)
JNIEXPORT jint JNICALL Java_eisbot_proxy_JNIBWAPI_getAverageFPS (JNIEnv *env, jobject jObj)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_sendText (JNIEnv *env, jobject jObj, jstring msg)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_setCameraLocation (JNIEnv *jEnv, jobject jObj, jint cameraX, jint cameraY)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_pingMinimap (JNIEnv *env, jobject jObj, jint x, jint y)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawBox (JNIEnv *env, jobject jObj, jint left, jint top, jint right, jint bottom, jint color, jboolean fill, jboolean screenCoords)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawCircle (JNIEnv *env, jobject jObj, jint x, jint y, jint radius, jint color, jboolean fill, jboolean screenCoords)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawLine (JNIEnv *env, jobject jObj, jint x1, jint y1, jint x2, jint y2, jint color, jboolean screenCoords)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawDot (JNIEnv *env, jobject jObj, jint x, jint y, jint color, jboolean screenCoords)
JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawText (JNIEnv *env, jobject jObj, jint x, jint y, jstring msg, jboolean screenCoords)

Variables

JNIEnvjEnv
jobject classref
jmethodID printCallback
bool running = true
std::map< int, UnitTypeunitTypeMap
std::map< int, TechTypetechTypeMap
std::map< int, UpgradeTypeupgradeTypeMap
std::map< int, WeaponTypeweaponTypeMap
std::map< int, UnitSizeTypeunitSizeTypeMap
std::map< int, BulletTypebulletTypeMap
std::map< int, DamageTypedamageTypeMap
std::map< int, ExplosionTypeexplosionTypeMap
std::map< BWTA::Region *, int > regionMap
jintintBuf
int bufferSize = 5000000
boolean showHealth = false
boolean showTargets = false
boolean showIDs = false
bool keyState [256]
double TO_DEGREES = 180.0/3.14159
double fixedScale = 100.0

Function Documentation

Draws health boxes for units

Here is the call graph for this function:

Here is the caller graph for this function:

Draws the IDs of each unit.

Here is the call graph for this function:

Here is the caller graph for this function:

Draws the targets of each unit.

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_build ( JNIEnv env,
jobject  jObj,
jint  unitID,
jint  tx,
jint  ty,
jint  typeID 
)

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawBox ( JNIEnv env,
jobject  jObj,
jint  left,
jint  top,
jint  right,
jint  bottom,
jint  color,
jboolean  fill,
jboolean  screenCoords 
)

Here is the call graph for this function:

JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawCircle ( JNIEnv env,
jobject  jObj,
jint  x,
jint  y,
jint  radius,
jint  color,
jboolean  fill,
jboolean  screenCoords 
)

Here is the call graph for this function:

JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawDot ( JNIEnv env,
jobject  jObj,
jint  x,
jint  y,
jint  color,
jboolean  screenCoords 
)

Here is the call graph for this function:

JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawLine ( JNIEnv env,
jobject  jObj,
jint  x1,
jint  y1,
jint  x2,
jint  y2,
jint  color,
jboolean  screenCoords 
)

Here is the call graph for this function:

JNIEXPORT void JNICALL Java_eisbot_proxy_JNIBWAPI_drawText ( JNIEnv env,
jobject  jObj,
jint  x,
jint  y,
jstring  msg,
jboolean  screenCoords 
)

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_follow ( JNIEnv env,
jobject  jObj,
jint  unitID,
jint  targetID 
)

Here is the call graph for this function:

JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_gather ( JNIEnv env,
jobject  jObj,
jint  unitID,
jint  targetID 
)

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Returns the list of active units in the game.

Each unit takes up a fixed number of integer values. Currently: 112

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_land ( JNIEnv env,
jobject  jObj,
jint  unitID,
jint  tx,
jint  ty 
)

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_load ( JNIEnv env,
jobject  jObj,
jint  unitID,
jint  targetID 
)

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_repair ( JNIEnv env,
jobject  jObj,
jint  unitID,
jint  targetID 
)

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Entry point from Java

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_unload ( JNIEnv env,
jobject  jObj,
jint  unitID,
jint  targetID 
)

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

Here is the call graph for this function:

JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_upgrade ( JNIEnv env,
jobject  jObj,
jint  unitID,
jint  upgradeID 
)

Here is the call graph for this function:

Here is the call graph for this function:

JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_useTech__III ( JNIEnv env,
jobject  jObj,
jint  unitID,
jint  techID,
jint  targetID 
)

Here is the call graph for this function:

JNIEXPORT jboolean JNICALL Java_eisbot_proxy_JNIBWAPI_useTech__IIII ( JNIEnv env,
jobject  jObj,
jint  unitID,
jint  techID,
jint  x,
jint  y 
)

Here is the call graph for this function:

void javaPrint ( char *  msg)

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int bufferSize = 5000000
double fixedScale = 100.0
bool keyState[256]
bool running = true
boolean showHealth = false
boolean showIDs = false
boolean showTargets = false
double TO_DEGREES = 180.0/3.14159
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines