#pragma once #include "player.h" #include class Goodie; #define CHECK_ROTATING 0 #define LEAVE_ISLAND 1 #define DRIVE_AROUND 2 #define NEAR_GOODIE 3 #define NEAR_OPPONENT 4 #define NEAR_OBSTACLE 5 #define COLL_ZONE 0 #define ATTACK_ZONE 1 #define FIRE_ZONE 2 #define DRIVE_ZONE 3 #define COLL_DIST 10 #define ATTACK_DIST 75 #define SPTR boost::shared_ptr class AIPlayer : public Player { public: AIPlayer(void); ~AIPlayer(void); Player *activeOpponent; virtual void update(float dt); protected: float speedCounter; float steeringCounter; int speedMod; int steeringMod; bool needNewRand; float linksrechts; float timer; //StateMachine int myState; int myZone; bool isLeaving(Vector center, float ch); bool isObstacleNear(); bool isNear(); bool isGoodieNear(); void driveAround(float dt, Vector center, float ch); void driveTo(float dt, Vector position, float speed); void selectWeapon(); float drTimer; float lastNewPositionTime; Vector driveToPosition; Goodie *activeGoodie; float frTimer; float lastFire; Vector obstaclePos; };