worldmodel.h~
来自「这是一支完整的uva球队」· H~ 代码 · 共 948 行 · 第 1/4 页
H~
948 行
// methods that return the number of players in a certain area of the field int getNrInSetInRectangle ( ObjectSetT objectSet, Rect *rect = NULL ); int getNrInSetInCircle ( ObjectSetT objectSet, Circle c ); int getNrInSetInCone ( ObjectSetT objectSet, double dWidth, VecPosition start, VecPosition end ); bool isEmptySpace ( ObjectT obj, AngDeg ang, double dDist = 4.0 ); bool coordinateWith ( ObjectT obj ); // method that return the closest or fastest player to a certain pos orobject ObjectT getClosestInSetTo ( ObjectSetT objectSet, ObjectT o , double *dDist = NULL, double dConfThr = -1.0 ); ObjectT getClosestInSetTo ( ObjectSetT objectSet, VecPosition pos, double *dDist = NULL, double dConfThr = -1.0 ); ObjectT getClosestInSetTo ( ObjectSetT objectSet, Line l, VecPosition pos1, VecPosition pos2, double *dDistToLine= NULL, double *dDistPos1To=NULL); ObjectT getClosestRelativeInSet ( ObjectSetT set, double *dDist = NULL ); ObjectT getClosestDangerousOpp ( double *dDist ); ObjectT getSecondClosestInSetTo ( ObjectSetT objectSet, ObjectT o, double *dDist = NULL, double dConfThr = -1.0 ); ObjectT getSecondClosestRelativeInSet( ObjectSetT set, double *dDist = NULL ); void createInterceptFeatures ( ); ObjectT getFastestInSetTo ( ObjectSetT objectSet, ObjectT o, int *iCycles = NULL ); ObjectT getFastestInSetTo ( ObjectSetT objectSet, VecPosition pos, VecPosition vel, double dDecay, int *iCycles = NULL ); ObjectT getFurthestInSetTo ( ObjectSetT objectSet, ObjectT o , double *dDist = NULL, double dConfThr = -1.0 ); ObjectT getFurthestRelativeInSet ( ObjectSetT set, double *dDist = NULL ); VecPosition getPosClosestOpponentTo ( double *dDist = NULL, ObjectT o =OBJECT_ILLEGAL); double getMaxTraveledDistance ( ObjectT o ); // various methods dealing with sets of objects ObjectT getFirstEmptySpotInSet ( ObjectSetT objectSet, int iUnknownPlayer=-1); // boolean methods that indicate whether an object fulfills a constraint bool isVisible ( ObjectT o ); bool isBallKickable ( ); bool isBallCatchable ( ); bool isBallHeadingToGoal ( ); bool isBallInOurPossesion ( ); bool isBallInOwnPenaltyArea ( ); bool isInOwnPenaltyArea ( VecPosition pos ); bool isInTheirPenaltyArea ( VecPosition pos ); bool isConfidenceGood ( ObjectT ); bool isConfidenceVeryGood ( ObjectT ); bool isOnside ( ObjectT ); bool isOpponentAtAngle ( AngDeg ang, double dDist ); // various methods that supply specific information about the field Time getTimeFromConfidence ( double dConf ); double getOffsideX ( bool bIncludeComm=true); VecPosition getOuterPositionInField ( VecPosition pos, AngDeg ang, double dDist = 3.0, bool bWithPenalty=true); AngDeg getDirectionOfWidestAngle ( VecPosition posOrg, AngDeg angMin, AngDeg angMax, AngDeg *ang, double dDist ); bool isInField ( VecPosition pos, double dMargin = 1 ); bool isBeforeGoal ( VecPosition pos ); // strategic positioning VecPosition getStrategicPosition ( ObjectT obj, FormationT ft = FT_ILLEGAL ); VecPosition getStrategicPosition ( int iPlayer = -1, FormationT ft = FT_ILLEGAL ); VecPosition getMarkingPosition ( VecPosition pos, double dDist, MarkT mark ); int getClosestPlayerInFormationTo( VecPosition pos, bool bWithGoalie = 1, ObjectT obj=OBJECT_ILLEGAL, PlayerSetT ps = PS_ALL, FormationT ft = FT_ILLEGAL ); // methods for computing the actual argument for a soccer command. double getActualKickPowerRate ( ); double getKickPowerForSpeed ( double dDesiredSpeed ); double getKickSpeedToTravel ( double dDistance, double dEndSpeed ); double getFirstSpeedFromEndSpeed ( double dEndSpeed, double dCycles, double dDecay = -1.0 ); double getFirstSpeedFromDist ( double dDist, double dCycles, double dDecay = -1.0 ); double getEndSpeedFromFirstSpeed ( double dFirstSpeed, double dCycles ); AngDeg getAngleForTurn ( AngDeg angDesiredAngle, double dSpeed, ObjectT o=OBJECT_ILLEGAL); AngDeg getActualTurnAngle ( AngDeg angActualAngle, double dSpeed, ObjectT o=OBJECT_ILLEGAL); double getPowerForDash ( VecPosition posRelTo, AngDeg angBody, VecPosition vel, double dEffort, int iCycles = 1 ); ////////////////////////// VARIOUS (WorldModel.C) /////////////////////////// // constructor WorldModel ( ServerSettings *ss, PlayerSettings *ps, Formations *fs ); ~WorldModel ( ); // print information about WorldModel void show ( ostream &os = cout ); void show ( ObjectSetT set, ostream &os = cout ); void showQueuedCommands ( ostream &os = cout ); void show ( ObjectT o, ostream &os = cout ); // methods that deal with timing information bool waitForNewInformation ( ); // methods that deal with debugging void logObjectInformation ( int iLogLevel, ObjectT o ); void logDrawInfo ( int iLogLevel ); void logCoordInfo ( int iLogLevel ); bool logCircle ( int iLogLevel, VecPosition pos, double dRadius, bool bAll = false ); bool logLine ( int iLogLevel, VecPosition pos1, VecPosition pos2, bool bAll = false ); bool logDrawBallInfo ( int iLogLevel ); void drawCoordinationGraph ( ); // specific static variables char m_colorPlayers[11][8]; /*!< color information with which each player should draw its relevant info*/ int m_iMultX; /*!< This variable denotes with which value the x coordinates of the draw information should be multiplied in order to convert the coordinates to the coordinate system of the monitor*/ int m_iMultY; /*!< This variable denotes with which value the y coordinates of the draw information should be multiplied in order to convert the coordinates to the coordinate system of the monitor*/ bool isFeatureRelevant ( FeatureT type ); Feature getFeature ( FeatureT type ); bool setFeature ( FeatureT type, Feature feature ); int getBlockingOpponentNum ( ObjectT teammate ); bool canPassTo ( ObjectT teammate ); double getMinPassBallDist ( double dist ); bool isOpponentAtAngleEx ( AngDeg angA, AngDeg angB, double dDist); bool isShoot ( ); bool isPassGood ( ObjectT o ); ObjectT safePass ( ); bool canDribble ( AngDeg angle, VecPosition spoint ); bool isDribble ( ); VecPosition pointToKickTo ( ); VecPosition Expectpoint ( AngDeg angle, double dMag); bool isSetAtAngleEx ( AngDeg angA, AngDeg angB, double dDist, ObjectSetT Objectset ); int getLowStamina ( VecPosition ballPos, int playerNum); VecPosition getPointInLine ( Line line, VecPosition position, double distance ); VecPosition getPointInLine ( Line line, VecPosition position1, VecPosition position2, double distance ); AngDeg getDribbleAngle ( ); bool ifexistOppInCone ( ObjectSetT objectSet, double dwidth, VecPosition start, VecPosition end ); bool ifexist ( VecPosition RunToPoint ); bool ifCanPass ( VecPosition &predictAgentPos, double &speed ); double passSpeed ( double dDist ); DribbleT getDribbleType ( ); bool canPassTo ( ObjectT teammate, VecPosition &posTeammatePre, double &speed ); bool isDribbleInTheirPenaltyArea( ); bool isBallInThemPossesion ( ); void searchDangerousThreeOpp ( ObjectT Opp[], int index ); ObjectT searchFurtherDangerous ( ); ObjectT searchSecondDangerous ( ); VecPosition int CurrentTimeForDribble ;};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?