00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00063 #ifndef _FORMATIONS_
00064 #define _FORMATIONS_
00065
00066 #include "SoccerTypes.h"
00067
00068
00069
00070
00071
00088 class PlayerTypeInfo
00089 {
00090 PlayerT playerType;
00091 double dAttrX;
00092 double dAttrY;
00093 double dMinX;
00094 double dMaxX;
00095 bool bBehindBall;
00097 public:
00098 PlayerTypeInfo( );
00099 PlayerTypeInfo( PlayerT, double, double, double, double, bool );
00100
00101
00102 bool setValues( PlayerT, double, double, double, double, bool );
00103 void show ( ostream &os = cout );
00104
00105
00106 bool setPlayerType( PlayerT type );
00107 PlayerT getPlayerType( ) const;
00108 bool setAttrX ( double attrX );
00109 double getAttrX ( ) const;
00110 bool setAttrY ( double attrY );
00111 double getAttrY ( ) const;
00112 bool setMinX ( double minX );
00113 double getMinX ( ) const;
00114 bool setMaxX ( double maxX );
00115 double getMaxX ( ) const;
00116 bool setBehindBall( bool b );
00117 bool getBehindBall( ) const;
00118 };
00119
00120
00121
00122
00123
00124
00130 class FormationTypeInfo
00131 {
00132 FormationT formationType;
00133 VecPosition posHome[ MAX_TEAMMATES ];
00134 PlayerT playerType[ MAX_TEAMMATES ];
00135 PlayerTypeInfo playerTypeInfo[ MAX_PLAYER_TYPES ];
00137 public:
00138 FormationTypeInfo( );
00139 void show( ostream &os = cout );
00140
00141
00142 bool setFormationType ( FormationT type );
00143 FormationT getFormationType ( ) const;
00144 bool setPosHome ( VecPosition pos, int atIndex );
00145 bool setXPosHome ( double x, int atIndex );
00146 bool setYPosHome ( double y, int atIndex );
00147 VecPosition getPosHome ( int atIndex ) const;
00148 bool setPlayerType ( PlayerT type, int atIndex );
00149 PlayerT getPlayerType ( int atIndex ) const;
00150 bool setPlayerTypeInfo ( PlayerTypeInfo info, int atIndex );
00151 PlayerTypeInfo* getPlayerTypeInfo ( int atIndex );
00152 PlayerTypeInfo* getPlayerTypeInfoOfPlayer( int iPlayerInFormation );
00153 };
00154
00155
00156
00157
00158
00164 class Formations
00165 {
00166 FormationTypeInfo formations[ MAX_FORMATION_TYPES ];
00167 FormationT curFormation;
00168 int iPlayerInFormation;
00169 public:
00170 Formations( const char *strFile = NULL, FormationT ft=FT_ILLEGAL, int iNr=1);
00171 void show ( ostream &os = cout );
00172
00173
00174 VecPosition getStrategicPosition( int iPlayer,
00175 VecPosition posBall,
00176 double dMaxXInPlayMode );
00177
00178
00179 bool readFormations ( const char *strFile );
00180
00181
00182 bool setFormation ( FormationT formation );
00183 FormationT getFormation ( ) const;
00184 bool setPlayerInFormation( int number );
00185 int getPlayerInFormation( ) const;
00186 PlayerT getPlayerType ( ) const;
00187 };
00188
00189 #endif