HOG2
MapUnit.h
Go to the documentation of this file.
1 /*
2  * MapUnit.h
3  * hog2
4  *
5  * Created by Nathan Sturtevant on 4/23/07.
6  * Copyright 2007 Nathan Sturtevant, University of Alberta. All rights reserved.
7  *
8  */
9 
10 #include "Unit.h"
11 #include "Map2DEnvironment.h"
12 
13 #ifndef MAPUNIT_H
14 #define MAPUNIT_H
15 
17 
22 class MapUnit : public Unit<xyLoc, tDirection, MapEnvironment> {
23 public:
24  MapUnit(int x, int y)
25  :loc(x, y) { r = 1.0; g = 0; b = 0;}
26 
28  { loc = l; }
29  virtual void GetLocation(xyLoc &l)
30  { l = loc; }
31  virtual void OpenGLDraw(const MapEnvironment *, const MapSimulationInfo *) const;
32  virtual void GetGoal(xyLoc &s) { s = loc; }
33 protected:
34  GLfloat r, g, b;
36 };
37 
38 #endif
MapUnit::UpdateLocation
virtual void UpdateLocation(MapEnvironment *, xyLoc &l, bool, MapSimulationInfo *)
Definition: MapUnit.h:27
SimulationInfo
Definition: SimulationInfo.h:13
MapSimulationInfo
SimulationInfo< xyLoc, tDirection, MapEnvironment > MapSimulationInfo
Definition: MapUnit.h:16
xyLoc
Definition: Map2DEnvironment.h:37
MapUnit::MapUnit
MapUnit(int x, int y)
Definition: MapUnit.h:24
Map2DEnvironment.h
MapEnvironment
Definition: Map2DEnvironment.h:133
loc
Definition: MapGenerators.cpp:296
MapUnit::GetLocation
virtual void GetLocation(xyLoc &l)
Definition: MapUnit.h:29
MapUnit::b
GLfloat b
Definition: MapUnit.h:34
MapUnit::OpenGLDraw
virtual void OpenGLDraw(const MapEnvironment *, const MapSimulationInfo *) const
Definition: MapUnit.cpp:13
MapUnit::loc
xyLoc loc
Definition: MapUnit.h:35
MapUnit::GetGoal
virtual void GetGoal(xyLoc &s)
Definition: MapUnit.h:32
MapUnit::g
GLfloat g
Definition: MapUnit.h:34
MapUnit
A simple map-based unit.
Definition: MapUnit.h:22
MapUnit::r
GLfloat r
Definition: MapUnit.h:34
Unit.h
Unit
Definition: Unit.h:23