www.pudn.com > Product_Submit2004.rar > BruceLee.h, change:2004-04-22,size:2754b


#ifndef BruceLee_H 
#define BruceLee_H 
 
#include "Dude.h" 
#include "../TOOLS/Utilities.h" 
#include "../TOOLS/KickSelecta.h" 
 
 
class BruceLee : public Dude { 
public: 
	BruceLee(); 
  ~BruceLee(); 
 
	virtual void NewReadyModel(); 
	virtual void NewPlayingModel(); 
  virtual void NewGoHomeModel(); 
 
  // NOTE !!!!!! 
  // the first few entries in this struct should be *identical* to NormalMessage. All the extras 
  // should go AFTER. This is important. Don't screw it up. 
  struct CaptainMessage { 
    bool chasing; //1 
    double distance; // 4 
    signed char position[4]; // 4 
    short upperX[4]; // 8 
    short upperY[4]; // 8 
    short lowerX[4]; // 8 
    short lowerY[4]; // 8 
    short homeX[4]; // 8 
    short homeY[4]; // 8 
  }; 
  struct NormalMessage { 
    bool chasing; //1 
    double distance; // 4 
  }; 
 
  struct RobotRegion { 
    int upperX; 
    int upperY; 
    int lowerX; 
    int lowerY; 
    int homeX; 
    int homeY; 
  }; 
 
  enum { 
    BL_GOALKEEPER = 0, 
    BL_LEFTSTRIKER = 1, 
    BL_RIGHTSTRIKER = 2, 
    BL_LEFTDEFENDER = 3, 
    BL_RIGHTDEFENDER = 4, 
    BL_CENTRESTRIKER = 5, 
    BL_CENTREDEFENDER = 6, 
    NUM_POSITIONS = 7 
  }; 
 
private: 
  void RunCaptain(); 
  void MovePlayer(int currentPosition, int newPosition); 
  bool isTeamOnOffense; 
  byte robotPosition[4]; // links botid-1 ---> positions (as in, the enum above) 
  bool isCaptain; 
 
  double lastBallDistance; 
 
  bool IsBallVisible(); 
  bool IsBallWithinChaseBounds(); 
  bool IsBallWithinNonEnlargedChaseBounds(); 
  bool IsSelfWithinChaseBounds(); 
  bool IsAnybodyChasing(); 
  bool IsChasePaused(); 
  bool AmIAllowedToChase(double); 
  int WhoIsChasing(); 
  int WhoIsClosestToBall(); 
  int WhoIsClosestToBallIncludingMe(); 
  double ClosestToBall(); 
  void AllocatePositions(int notThisId, int position1, int position2); 
  void OneInchPunch(); 
  void CheckWireless(); 
   
  bool inPlaying; 
  bool inGoHome; 
  Utilities utils; 
  KickSelecta ks; 
 
  bool debugOutput; 
  bool oneInchPunch; 
 
  int chaseUpperX; 
  int chaseUpperY; 
  int chaseLowerX; 
  int chaseLowerY; 
 
  int boundOffset; 
 
  double actualHomeX; 
  double actualHomeY; 
  int homeX; 
  int homeY; 
  int homeRadius; 
  int homeErrorDistance; 
 
  bool chasePaused; 
  long pauseChaseUntil; 
 
  int offensiveSwitchY; 
  int defensiveSwitchY; 
 
  long lastSwitchTime; 
   
  long timeOfLastChase; 
  bool keeperRoaming; 
 
  long watchingBallCounter; 
  bool lastLookedLeft; 
 
  signed char myPosition; 
  long lastReceivedTime[4]; 
  RobotRegion robotRegions[NUM_POSITIONS]; 
  NormalMessage othersNormal[4]; 
  CaptainMessage othersCaptain; 
 
  char* previousTrick; 
  long previousTrickFrame; 
}; 
 
#endif // BruceLee_H