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
00067 #ifndef _FORMATIONS_
00068 #define _FORMATIONS_
00069
00070 #include "SoccerTypes.h"
00071
00072
00073
00074
00075
00092 class PlayerTypeInfo
00093 {
00094 PlayerT playerType;
00095 double dAttrX;
00096 double dAttrY;
00097 double dMinX;
00098 double dMaxX;
00099 bool bBehindBall;
00101 public:
00102 PlayerTypeInfo( );
00103 PlayerTypeInfo( PlayerT, double, double, double, double, bool );
00104
00105
00106 bool setValues( PlayerT, double, double, double, double, bool );
00107 void show ( ostream &os = cout );
00108
00109
00110 bool setPlayerType( PlayerT type );
00111 PlayerT getPlayerType( ) const;
00112 bool setAttrX ( double attrX );
00113 double getAttrX ( ) const;
00114 bool setAttrY ( double attrY );
00115 double getAttrY ( ) const;
00116 bool setMinX ( double minX );
00117 double getMinX ( ) const;
00118 bool setMaxX ( double maxX );
00119 double getMaxX ( ) const;
00120 bool setBehindBall( bool b );
00121 bool getBehindBall( ) const;
00122 };
00123
00124
00125
00126
00127
00128
00134 class FormationTypeInfo
00135 {
00136 FormationT formationType;
00137 VecPosition posHome[ MAX_TEAMMATES ];
00138 PlayerT playerType[ MAX_TEAMMATES ];
00139 PlayerTypeInfo playerTypeInfo[ MAX_PLAYER_TYPES ];
00141 public:
00142 FormationTypeInfo( );
00143 void show( ostream &os = cout );
00144
00145
00146 bool setFormationType ( FormationT type );
00147 FormationT getFormationType ( ) const;
00148 bool setPosHome ( VecPosition pos, int atIndex );
00149 bool setXPosHome ( double x, int atIndex );
00150 bool setYPosHome ( double y, int atIndex );
00151 VecPosition getPosHome ( int atIndex ) const;
00152 bool setPlayerType ( PlayerT type, int atIndex );
00153 PlayerT getPlayerType ( int atIndex ) const;
00154 bool setPlayerTypeInfo ( PlayerTypeInfo info, int atIndex );
00155 PlayerTypeInfo* getPlayerTypeInfo ( int atIndex );
00156 PlayerTypeInfo* getPlayerTypeInfoOfPlayer( int iPlayerInFormation );
00157 };
00158
00159
00160
00161
00162
00168 class Formations
00169 {
00170 FormationTypeInfo formations[ MAX_FORMATION_TYPES ];
00171 FormationT curFormation;
00172 int iPlayerInFormation;
00173 public:
00174 Formations( const char *strFile = NULL, FormationT ft=FT_ILLEGAL, int iNr=1);
00175 void show ( ostream &os = cout );
00176
00177
00178 VecPosition getStrategicPosition( int iPlayer,
00179 VecPosition posBall,
00180 double dMaxXInPlayMode );
00181
00182
00183 bool readFormations ( const char *strFile );
00184
00185
00186 bool setFormation ( FormationT formation );
00187 FormationT getFormation ( ) const;
00188 bool setPlayerInFormation( int number );
00189 int getPlayerInFormation( ) const;
00190 PlayerT getPlayerType ( int iIndex = -1 ) const;
00191 };
00192
00193 #endif