📄 serversettings.cpp
字号:
return ( true );
}
/*! Get method for the 'dInertiaMoment' member variable.
\return the inertia moment of a player (affects actual turn angle depending
on speed) */
double ServerSettings::getInertiaMoment( ) const
{
return ( dInertiaMoment );
}
/*! Set method for the 'iSenseBodyStep' member variable.
\param i an integer value representing a new length of the interval (in ms)
between sense_body information messages
\return a boolean indicating whether the update was successful */
bool ServerSettings::setSenseBodyStep( int i )
{
iSenseBodyStep = i;
return ( true );
}
/*! Get method for the 'iSenseBodyStep' member variable.
\return the length of the interval (in ms) between sense_body information
messages */
int ServerSettings::getSenseBodyStep( ) const
{
// NOTE: do not take slow down factor into account for send intervals
// already done by server
return iSenseBodyStep ; // * iSlowDownFactor );
}
/*! Set method for the 'dCatchableAreaL' member variable.
\param d a double value representing a new length of the area around the
goalkeeper in which he can catch the ball
\return a boolean indicating whether the update was successful */
bool ServerSettings::setCatchableAreaL( double d )
{
dCatchableAreaL = d;
return ( true );
}
/*! Get method for the 'dCatchableAreaL' member variable.
\return the length of the area around the goalkeeper in which he can catch
the ball */
double ServerSettings::getCatchableAreaL( ) const
{
return ( dCatchableAreaL );
}
/*! Set method for the 'dCatchableAreaW' member variable.
\param d a double value representing a new width of the area around the
goalkeeper in which he can catch the ball
\return a boolean indicating whether the update was successful */
bool ServerSettings::setCatchableAreaW( double d )
{
dCatchableAreaW = d;
return ( true );
}
/*! Get method for the 'dCatchableAreaW' member variable.
\return the width of the area around the goalkeeper in which he can catch
the ball */
double ServerSettings::getCatchableAreaW( ) const
{
return ( dCatchableAreaW );
}
/*! Set method for the 'dCatchProbability' member variable.
\param d a double value representing a new probability for a goalkeeper to
catch the ball
\return a boolean indicating whether the update was successful */
bool ServerSettings::setCatchProbability( double d )
{
dCatchProbability = d;
return ( true );
}
/*! Get method for the 'dCatchProbability' member variable.
\return the probability for a goalkeeper to catch the ball */
double ServerSettings::getCatchProbability( ) const
{
return ( dCatchProbability );
}
/*! Set method for the 'iCatchBanCycle' member variable.
\param i an integer value representing a new number of cycles after a catch
in which the goalkeeper cannot catch again
\return a boolean indicating whether the update was successful */
bool ServerSettings::setCatchBanCycle( int i )
{
iCatchBanCycle = i;
return ( true );
}
/*! Get method for the 'iCatchBanCycle' member variable.
\return the number of cycles after a catch in which the goalkeeper cannot
catch again */
int ServerSettings::getCatchBanCycle( ) const
{
return ( iCatchBanCycle );
}
/*! Set method for the 'iGoalieMaxMoves' member variable.
\param i an integer value representing a new maximum number of 'move'
actions allowed for a goalkeeper after a catch
\return a boolean indicating whether the update was successful */
bool ServerSettings::setGoalieMaxMoves( int i )
{
iGoalieMaxMoves = i;
return ( true );
}
/*! Get method for the 'iGoalieMaxMoves' member variable.
\return the maximum number of 'move' actions allowed for a goalkeeper after
a catch */
int ServerSettings::getGoalieMaxMoves( ) const
{
return ( iGoalieMaxMoves );
}
/*! Set method for the 'dBallSize' member variable.
\param d a double value representing a new ball size
\return a boolean indicating whether the update was successful */
bool ServerSettings::setBallSize( double d )
{
dBallSize = d;
// NOTE: also update parameters for which the value depends on this variable
dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
return ( true );
}
/*! Get method for the 'dBallSize' member variable.
\return the size (=radius) of the ball */
double ServerSettings::getBallSize( ) const
{
return ( dBallSize );
}
/*! Set method for the 'dBallDecay' member variable.
\param d a double value representing a new ball speed decay per cycle
\return a boolean indicating whether the update was successful */
bool ServerSettings::setBallDecay( double d )
{
dBallDecay = d;
return ( true );
}
/*! Get method for the 'dBallDecay' member variable.
\return the ball speed decay per cycle */
double ServerSettings::getBallDecay( ) const
{
return ( dBallDecay );
}
/*! Set method for the 'dBallRand' member variable.
\param d a double value representing a new random error in the
ball movement
\return a boolean indicating whether the update was successful */
bool ServerSettings::setBallRand( double d )
{
dBallRand = d;
return ( true );
}
/*! Get method for the 'dBallRand' member variable.
\return the random error in the ball movement */
double ServerSettings::getBallRand( ) const
{
return ( dBallRand );
}
/*! Set method for the 'dBallWeight' member variable.
\param d a double value representing a new weight of the ball (for wind)
\return a boolean indicating whether the update was successful */
bool ServerSettings::setBallWeight( double d )
{
dBallWeight = d;
return ( true );
}
/*! Get method for the 'dBallWeight' member variable.
\return the weight of the ball (for wind) */
double ServerSettings::getBallWeight( ) const
{
return ( dBallWeight );
}
/*! Set method for the 'dBallSpeedMax' member variable.
\param d a double value representing a new maximum speed of the ball
\return a boolean indicating whether the update was successful */
bool ServerSettings::setBallSpeedMax( double d )
{
dBallSpeedMax = d;
return ( true );
}
/*! Get method for the 'dBallSpeedMax' member variable.
\return the maximum speed of the ball */
double ServerSettings::getBallSpeedMax( ) const
{
return ( dBallSpeedMax );
}
/*! Set method for the 'dBallAccelMax' member variable.
\param d a double value representing a new maximum acceleration of the ball
per cycle
\return a boolean indicating whether the update was successful */
bool ServerSettings::setBallAccelMax( double d )
{
dBallAccelMax = d;
return ( true );
}
/*! Get method for the 'dBallAccelMax' member variable.
\return the maximum acceleration of the ball per cycle */
double ServerSettings::getBallAccelMax( ) const
{
return ( dBallAccelMax );
}
/*! Set method for the 'dWindForce' member variable.
\param d a double value representing a new force of the wind
\return a boolean indicating whether the update was successful */
bool ServerSettings::setWindForce( double d )
{
dWindForce = d;
return ( true );
}
/*! Get method for the 'dWindForce' member variable.
\return the force of the wind */
double ServerSettings::getWindForce( ) const
{
return ( dWindForce );
}
/*! Set method for the 'dWindDir' member variable.
\param d a double value representing a new direction of the wind
\return a boolean indicating whether the update was successful */
bool ServerSettings::setWindDir( double d )
{
dWindDir = d;
return ( true );
}
/*! Get method for the 'dWindDir' member variable.
\return the direction of the wind */
double ServerSettings::getWindDir( ) const
{
return ( dWindDir );
}
/*! Set method for the 'dWindRand' member variable.
\param d a double value representing a new random error in wind direction
\return a boolean indicating whether the update was successful */
bool ServerSettings::setWindRand( double d )
{
dWindRand = d;
return ( true );
}
/*! Get method for the 'dWindRand' member variable.
\return the random error in wind direction */
double ServerSettings::getWindRand( ) const
{
return ( dWindRand );
}
/*! Set method for the 'bWindRandom' member variable.
\param b a boolean indicating whether wind force and direction are random
\return a boolean indicating whether the update was successful */
bool ServerSettings::setWindRandom( bool b )
{
bWindRandom = b;
return ( true );
}
/*! Get method for the 'bWindRandom' member variable.
\return boolean indicating whether wind force and direction are random */
bool ServerSettings::getWindRandom( ) const
{
return bWindRandom;
}
/*! Set method for the 'dKickableMargin' member variable.
\param d a double value representing a new margin around a player in which
the ball is kickable (kickable area thus equals kickable_margin + ball_size
+ player_size)
\return a boolean indicating whether the update was successful */
bool ServerSettings::setKickableMargin( double d )
{
dKickableMargin = d;
// NOTE: also update parameters for which the value depends on this variable
dMaximalKickDist = ( dKickableMargin + dPlayerSize + dBallSize );
return ( true );
}
/*! Get method for the 'dKickableMargin' member variable.
\return the margin around a player in which the ball is kickable (kickable
area thus equals kickable_margin + ball_size + player_size) */
double ServerSettings::getKickableMargin( ) const
{
return ( dKickableMargin );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -