HOG2
Functions | Variables
Sample.cpp File Reference
#include "Common.h"
#include "Sample.h"
#include "UnitSimulation.h"
#include "EpisodicSimulation.h"
#include "Map2DEnvironment.h"
#include "RandomUnits.h"
#include "TemplateAStar.h"
#include "GraphEnvironment.h"
#include "MapGenerators.h"
Include dependency graph for Sample.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 
void CreateSimulation (int id)
 This function is used to allocate the unit simulated that you want to run. More...
 
void InstallHandlers ()
 Allows you to install any keyboard handlers needed for program interaction. More...
 
void MyWindowHandler (unsigned long windowID, tWindowEventType eType)
 
void MyFrameHandler (unsigned long windowID, unsigned int viewport, void *)
 
void doExport ()
 
int MyCLHandler (char *argument[], int maxNumArgs)
 
void MyDisplayHandler (unsigned long windowID, tKeyboardModifier mod, char key)
 
void MyRandomUnitKeyHandler (unsigned long windowID, tKeyboardModifier, char)
 
void MyPathfindingKeyHandler (unsigned long windowID, tKeyboardModifier, char)
 
bool MyClickHandler (unsigned long windowID, int, int, point3d loc, tButtonType button, tMouseEventType mType)
 

Variables

bool mouseTracking = false
 
bool runningSearch1 = false
 
bool runningSearch2 = false
 
bool bSaveAndQuit = false
 
int px1
 
int py1
 
int px2
 
int py2
 
int absType = 0
 
int mazeSize = 512
 
int gStepsPerFrame = 4
 
std::vector< UnitMapSimulation * > unitSims
 
TemplateAStar< xyLoc, tDirection, MapEnvironmenta1
 
TemplateAStar< xyLoc, tDirection, MapEnvironmenta2
 
MapEnvironmentma1 = 0
 
MapEnvironmentma2 = 0
 
GraphDistanceHeuristicgdh = 0
 
GraphDistanceHeuristicgdh2 = 0
 
std::vector< xyLocpath
 

Function Documentation

◆ CreateSimulation()

void CreateSimulation ( int  id)

This function is used to allocate the unit simulated that you want to run.

Any parameters or other experimental setup can be done at this time.

Definition at line 56 of file Sample.cpp.

References gDefaultMap, kMinTime, kWinter, MakeMaze(), mazeSize, Map::Scale(), Map::SetTileSet(), and unitSims.

Referenced by MyWindowHandler().

◆ doExport()

void doExport ( )

Definition at line 221 of file Sample.cpp.

Referenced by MyCLHandler().

◆ InstallHandlers()

void InstallHandlers ( )

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 45 of file Sample.cpp.

References InstallHandlers(), and RunHOGGUI().

◆ MyCLHandler()

int MyCLHandler ( char *  argument[],
int  maxNumArgs 
)

Definition at line 226 of file Sample.cpp.

References bSaveAndQuit, doExport(), gDefaultMap, mazeSize, and Map::Save().

Referenced by InstallHandlers().

◆ MyClickHandler()

bool MyClickHandler ( unsigned long  windowID,
int  ,
int  ,
point3d  loc,
tButtonType  button,
tMouseEventType  mType 
)

Definition at line 442 of file Sample.cpp.

References a1, a2, kMouseDown, kMouseDrag, kMouseUp, kRightButton, ma1, ma2, mouseTracking, px1, px2, py1, py2, runningSearch2, unitSims, xyLoc::x, and xyLoc::y.

Referenced by InstallHandlers().

◆ MyDisplayHandler()

void MyDisplayHandler ( unsigned long  windowID,
tKeyboardModifier  mod,
char  key 
)

◆ MyFrameHandler()

void MyFrameHandler ( unsigned long  windowID,
unsigned int  viewport,
void *   
)

◆ MyPathfindingKeyHandler()

void MyPathfindingKeyHandler ( unsigned long  windowID,
tKeyboardModifier  ,
char   
)

◆ MyRandomUnitKeyHandler()

void MyRandomUnitKeyHandler ( unsigned long  windowID,
tKeyboardModifier  ,
char   
)

◆ MyWindowHandler()

void MyWindowHandler ( unsigned long  windowID,
tWindowEventType  eType 
)

Variable Documentation

◆ a1

◆ a2

Definition at line 35 of file Sample.cpp.

Referenced by line2d::crosses(), MyClickHandler(), and MyFrameHandler().

◆ absType

int absType = 0

Definition at line 29 of file Sample.cpp.

◆ bSaveAndQuit

bool bSaveAndQuit = false

Definition at line 27 of file Sample.cpp.

Referenced by MyCLHandler(), and MyFrameHandler().

◆ gdh

Definition at line 38 of file Sample.cpp.

Referenced by MyFrameHandler(), MyRandomUnitKeyHandler(), and MyWindowHandler().

◆ gdh2

Definition at line 39 of file Sample.cpp.

Referenced by MyFrameHandler(), MyRandomUnitKeyHandler(), and MyWindowHandler().

◆ gStepsPerFrame

int gStepsPerFrame = 4

Definition at line 31 of file Sample.cpp.

Referenced by MyDisplayHandler(), and MyFrameHandler().

◆ ma1

MapEnvironment* ma1 = 0

Definition at line 36 of file Sample.cpp.

Referenced by MyClickHandler(), MyFrameHandler(), and MyWindowHandler().

◆ ma2

MapEnvironment* ma2 = 0

Definition at line 37 of file Sample.cpp.

Referenced by MyClickHandler(), MyFrameHandler(), and MyWindowHandler().

◆ mazeSize

int mazeSize = 512

Definition at line 30 of file Sample.cpp.

Referenced by CreateSimulation(), and MyCLHandler().

◆ mouseTracking

bool mouseTracking = false

Definition at line 24 of file Sample.cpp.

Referenced by MyClickHandler(), MyFrameHandler(), and MyWindowHandler().

◆ path

std::vector<xyLoc> path

◆ px1

int px1

◆ px2

int px2

◆ py1

int py1

◆ py2

int py2

◆ runningSearch1

bool runningSearch1 = false

Definition at line 25 of file Sample.cpp.

Referenced by MyFrameHandler(), and MyWindowHandler().

◆ runningSearch2

bool runningSearch2 = false

Definition at line 26 of file Sample.cpp.

Referenced by MyClickHandler(), MyFrameHandler(), and MyWindowHandler().

◆ unitSims

std::vector<UnitMapSimulation *> unitSims