/* * PixsailAIController.h * Pirates2011 * * Created by Alan Dorin on 19/04/11. * Copyright 2011 __MyCompanyName__. All rights reserved. * */ #ifndef _PIXSAIL_AI_H_ #define _PIXSAIL_AI_H_ #include "AIController.h" // This class is not for release to the students as an example! // Instead, it is the enemy ship against which they must fight in their final assignment // by using their fleet class PixsailAIController : public AIController { private: public: PixsailAIController(void); ~PixsailAIController(void); // The methods below are explained in some detail in the .cpp file // This is the most important method... you *must* write it and within it, include // instructions on how to navigate your ship, when to collect gold and shoot the cannon etc. Globals::ShipAction computeNextAction(void); Globals::ShipAction avoidRocksShootAllOthers(void); // check full range to see if a ship is ahead and target is not blocked by a rock bool isTargetShipInRange(void); bool isTargetShipInRangeDirection(Globals::NeighbourDirection cannonDirection); // check full range to see if a ship that is not blocked by a rock is facing me // return the range of enemy (or 0 if none) long isEnemyThreateningMeFromDirection(Globals::NeighbourDirection cannonDirection); Globals::ShipAction getRandomTurnAction(void); bool PixsailAIController::getRandomBool(void); Globals::ShipAction evadeImmediateThreats(void); Globals::ShipAction turnToFlee(void); long calcNextXInc(Globals::NeighbourDirection direction); long calcNextYInc(Globals::NeighbourDirection direction); bool isCellEmpty(long relX, long relY); void mimicSignals(long aheadX, long aheadY); void randomiseSignals(void); }; #endif