HOG2
AbsMapUnit.h
Go to the documentation of this file.
1 /*
2  * AbsMapUnit.h
3  * hog2
4  *
5  * Created by Nathan Sturtevant on 4/27/07.
6  * Copyright 2007 Nathan Sturtevant, University of Alberta. All rights reserved.
7  *
8  */
9 
10 #ifndef ABSMAPUNIT_H
11 #define ABSMAPUNIT_H
12 
13 #include "Unit.h"
14 #include "Map2DEnvironment.h"
15 
17 
19 
24 class AbsMapUnit : public BaseAbsMapUnit {
25 public:
26  AbsMapUnit(int x, int y)
27  :loc(x, y) { r = 1.0; g = 0; b = 0;}
28  virtual ~AbsMapUnit() {}
29 
30  virtual const char *GetName() = 0;
31  virtual bool MakeMove(AbsMapEnvironment *, OccupancyInterface<xyLoc,tDirection> *, AbsMapSimulationInfo *, tDirection &) = 0;
32  virtual void UpdateLocation(AbsMapEnvironment *, xyLoc &l, bool, AbsMapSimulationInfo *)
33  { loc = l; }
34  virtual void GetLocation(xyLoc &l)
35  { l = loc; }
36  virtual void GetGoal(xyLoc &s) = 0;
37  virtual void OpenGLDraw(const AbsMapEnvironment *, const AbsMapSimulationInfo *) const;
38  //void GetLocation(int &x, int &y) { x = loc.x; y = loc.y; }
39 // void SetColor(GLfloat _r, GLfloat _g, GLfloat _b) { r=_r; g=_g; b=_b; }
40 // void GetColor(GLfloat& _r, GLfloat& _g, GLfloat& _b) { _r=r; _g=g; _b=b; }
41 protected:
42  GLfloat r, g, b;
44 };
45 
46 #endif
SimulationInfo
Definition: SimulationInfo.h:13
AbsMapUnit
A simple map-based unit.
Definition: AbsMapUnit.h:24
AbsMapSimulationInfo
SimulationInfo< xyLoc, tDirection, AbsMapEnvironment > AbsMapSimulationInfo
Definition: AbsMapUnit.h:18
BaseAbsMapUnit
Unit< xyLoc, tDirection, AbsMapEnvironment > BaseAbsMapUnit
Definition: AbsMapUnit.h:16
xyLoc
Definition: Map2DEnvironment.h:37
AbsMapUnit::r
GLfloat r
Definition: AbsMapUnit.h:42
Map2DEnvironment.h
AbsMapUnit::MakeMove
virtual bool MakeMove(AbsMapEnvironment *, OccupancyInterface< xyLoc, tDirection > *, AbsMapSimulationInfo *, tDirection &)=0
AbsMapUnit::~AbsMapUnit
virtual ~AbsMapUnit()
Definition: AbsMapUnit.h:28
AbsMapUnit::OpenGLDraw
virtual void OpenGLDraw(const AbsMapEnvironment *, const AbsMapSimulationInfo *) const
Definition: AbsMapUnit.cpp:12
loc
Definition: MapGenerators.cpp:296
AbsMapUnit::loc
xyLoc loc
Definition: AbsMapUnit.h:43
AbsMapUnit::UpdateLocation
virtual void UpdateLocation(AbsMapEnvironment *, xyLoc &l, bool, AbsMapSimulationInfo *)
Definition: AbsMapUnit.h:32
AbsMapUnit::b
GLfloat b
Definition: AbsMapUnit.h:42
AbsMapUnit::g
GLfloat g
Definition: AbsMapUnit.h:42
tDirection
tDirection
Definition: Map2DEnvironment.h:77
AbsMapUnit::AbsMapUnit
AbsMapUnit(int x, int y)
Definition: AbsMapUnit.h:26
AbsMapUnit::GetName
virtual const char * GetName()=0
AbsMapUnit::GetLocation
virtual void GetLocation(xyLoc &l)
Definition: AbsMapUnit.h:34
AbsMapUnit::GetGoal
virtual void GetGoal(xyLoc &s)=0
Unit.h
Unit
Definition: Unit.h:23
OccupancyInterface< xyLoc, tDirection >