#ifndef _AS_GA_CHASER #define _AS_GA_CHASER /* #ifndef _AS_PC_MATRIX #include "pc_matrix.HPP" #endif */ #ifndef _AS_GA_ARENA #include "ga_arena.hpp" #endif #ifdef _AS_VERSION_PC const int AS_CHASER_MOVE_FACTOR = 100; const int AS_MAX_CHASERS = 10;//0;//50; #else const int AS_CHASER_MOVE_FACTOR = 25;//50; const int AS_MAX_CHASERS = 10; #endif const unsigned int AS_CHASER_ROTATE_FACTOR = 80; const int AS_CHASER_DIRECTION_UP = 0; const int AS_CHASER_DIRECTION_DOWN = 1; const int AS_CHASER_DIRECTION_LEFT = 2; const int AS_CHASER_DIRECTION_RIGHT = 3; const int AS_CHASER_LEGS = 1000; struct AsMapArrayElement; class AsDirectionGenerator { int GetRandomRightAngle(int currentDirection); int GetAvailableRightAngle(AsMapArrayElement *mapArray,int currentDirection); int IsWayAheadClear(AsMapArrayElement *mapArray,int currentDirection); public: AsDirectionGenerator(); int GetDirection(AsMapArrayElement *mapArray,int currentDirection); }; struct AsPathElement { int direction; int xBlock; int yBlock; int zBlock; }; class AsChaser; class AsArenaBuilder; class AsPlayer; class AsChaserManager { AsDirectionGenerator directionGenerator; AsChaser *chasers[AS_MAX_CHASERS]; int currentChaser; AsArenaBuilder *map; AsPlayer *player; int chaserCurrentTime; // same as game currenttime int numberToRelease; int maxChasers[2]; public: int numberOfChasers; AsChaserManager(); ~AsChaserManager(); void Reset(); void UpdateDirection(AsMapArrayElement *mapArray,AsChaser *chaser); int FindPlayer(AsChaser *chaser); int GroundSearch(int level,int row,int column, int direction, int length, int recurse, int depth); void GroundSearch2(int &distanceFound, int distanceTraversed, int level,int row,int column, int direction, int length, int type,int oldDirection,int rotation,int depth);//, AsPathElement *directions); void SetFeatures(AsArenaBuilder *_map,AsPlayer *_player); int Count(); AsChaser *GetCurrentChaser(); AsChaser *GetChaser(int i); int CheckPosition(int chaserNumber); void Update(int mapNumber); int TestChaserMovement(int chaserNumber); }; class AsChaser { int directionX; int directionZ; int reverseDirection; int currentDirection; public: //AsPathElement currentDirection[3]; // position int X; int Y; int Z; int oldX; int oldY; int oldZ; int xRoom; int yRoom; int zRoom; int delay; // rotation in units of AS_DEGREES_360 unsigned int aroundX; unsigned int aroundY; unsigned int aroundZ; //Matrix3D worldView[AS_MAX_REPLICATE]; void Move(unsigned int angle); int GetY() {return(Y);} SetY(int _Y) {Y = _Y;} public: AsChaser(); int chaseMode; void Reset(); int Delay(); int GetDirection(); int GetReverseDirection(); //int SetNextDirection(); void SetDirection(int direction); void SetPosition(int newX, int newY, int newZ); void StoreOldPosition(); void MoveForward(); void MoveBackward(); void MoveLeft(); void MoveRight(); void TurnLeft(); void TurnRight(); void LookUp(); void LookDown(); void TwistLeft(); void TwistRight(); void UpdatePosition(); }; #endif