Rally X
ELEN3009 Project by Justin Wernick and David Schneider
source/logic/EnemyCar.h
Go to the documentation of this file.
00001 #ifndef ENEMYCAR_H
00002 #define ENEMYCAR_H
00003 
00004 #include <cmath>
00005 
00006 #include "../presentation/BitmapStore.h"
00007 
00008 #include "../logic/Car.h"
00009 #include "../logic/PlayerCar.h"
00010 #include "../logic/Rock.h"
00011 #include "../logic/MazeMath.h"
00012 
00021 class EnemyCar: public Car
00022 {
00023     public:
00030         EnemyCar(double x, double y);
00031 
00032         //assignment and copy constructors have been left with the compiler generated versions
00033 
00043         void update(const Maze& maze, const list<PlayerCar>& players, const list<Rock>& rocks);
00044 
00048         void crash();
00049 
00053         void blind();
00054 
00055     private:
00061         enum States {
00062             BLINDED, 
00063             CHASING 
00064             };
00065 
00066         States _state; 
00067         double _targetX; 
00068         double _targetY; 
00069 
00085         void checkFacing(const Maze& maze, double chasingX, double chasingY, const list<Rock>& rocks);
00086 
00094         bool rockAtLocation(double x, double y, const list<Rock>& rocks);
00095 };
00096 
00097 #endif // ENEMYCAR_H
 All Classes Files Functions Variables Typedefs Enumerations Enumerator