C# Class Robocode.Rules

Constants and methods that defines the rules of Robocode. Constants are used for rules that will not change. Methods are provided for rules that can be changed between battles or which depends on some other factor.
Mostrar archivo Open project: f13mash/roboyuddh

Public Properties

Property Type Description
ACCELERATION double
DECELERATION double
GUN_TURN_RATE double
GUN_TURN_RATE_RADIANS double
MAX_BULLET_POWER double
MAX_TURN_RATE double
MAX_TURN_RATE_RADIANS double
MAX_VELOCITY double
MIN_BULLET_POWER double
RADAR_SCAN_RADIUS double
RADAR_TURN_RATE double
RADAR_TURN_RATE_RADIANS double
ROBOT_HIT_BONUS double
ROBOT_HIT_DAMAGE double

Public Methods

Method Description
GetBulletDamage ( double bulletPower ) : double

Returns the amount of damage of a bullet given a specific bullet power.

GetBulletHitBonus ( double bulletPower ) : double

Returns the amount of bonus given when a robot's bullet hits an opponent robot given a specific bullet power.

GetBulletSpeed ( double bulletPower ) : double

Returns the speed of a bullet given a specific bullet power measured in pixels/turn.

GetGunHeat ( double bulletPower ) : double

Returns the heat produced by firing the gun given a specific bullet power.

GetTurnRate ( double velocity ) : double

Returns the turn rate of a robot given a specific velocity measured in degrees/turn. GetTurnRateRadians(double)

GetTurnRateRadians ( double velocity ) : double

Returns the turn rate of a robot given a specific velocity measured in radians/turn. GetTurnRate(double)

GetWallHitDamage ( double velocity ) : double

Returns the amount of damage taken when robot hits a wall with a specific velocity.

Method Details

GetBulletDamage() public static method

Returns the amount of damage of a bullet given a specific bullet power.
public static GetBulletDamage ( double bulletPower ) : double
bulletPower double the energy power of the bullet.
return double

GetBulletHitBonus() public static method

Returns the amount of bonus given when a robot's bullet hits an opponent robot given a specific bullet power.
public static GetBulletHitBonus ( double bulletPower ) : double
bulletPower double the energy power of the bullet
return double

GetBulletSpeed() public static method

Returns the speed of a bullet given a specific bullet power measured in pixels/turn.
public static GetBulletSpeed ( double bulletPower ) : double
bulletPower double the energy power of the bullet.
return double

GetGunHeat() public static method

Returns the heat produced by firing the gun given a specific bullet power.
public static GetGunHeat ( double bulletPower ) : double
bulletPower double the energy power of the bullet
return double

GetTurnRate() public static method

Returns the turn rate of a robot given a specific velocity measured in degrees/turn. GetTurnRateRadians(double)
public static GetTurnRate ( double velocity ) : double
velocity double The velocity of the robot.
return double

GetTurnRateRadians() public static method

Returns the turn rate of a robot given a specific velocity measured in radians/turn. GetTurnRate(double)
public static GetTurnRateRadians ( double velocity ) : double
velocity double the velocity of the robot.
return double

GetWallHitDamage() public static method

Returns the amount of damage taken when robot hits a wall with a specific velocity.
public static GetWallHitDamage ( double velocity ) : double
velocity double the velocity of the robot.
return double

Property Details

ACCELERATION public_oe static_oe property

The acceleration of a robot, i.e. the increase of velocity when the robot moves forward, which is 1 pixel/turn.
public static double ACCELERATION
return double

DECELERATION public_oe static_oe property

The deceleration of a robot, i.e. the decrease of velocity when the robot moves backwards (or brakes), which is 2 pixels/turn.
public static double DECELERATION
return double

GUN_TURN_RATE public_oe static_oe property

The turning rate of the gun measured in degrees, which is 20 degrees/turn. Note, that if AdjustGunForRobotTurn = true has been set, the gun turn is independent of the robot turn. In this case the gun moves relatively to the screen.

If AdjustGunForRobotTurn = false has been set or AdjustGunForRobotTurn has not been called at all (this is the default), then the gun turn is dependent on the robot turn, and in this case the gun moves relatively to the robot body. GUN_TURN_RATE_RADIANS Robot.IsAdjustGunForRobotTurn

public static double GUN_TURN_RATE
return double

GUN_TURN_RATE_RADIANS public_oe static_oe property

The turning rate of the gun measured in radians instead of degrees. GUN_TURN_RATE
public static double GUN_TURN_RATE_RADIANS
return double

MAX_BULLET_POWER public_oe static_oe property

The maximum bullet power, i.e. the maximum amount of energy that can be transferred to a bullet when it is fired, which is 3 energy points.
public static double MAX_BULLET_POWER
return double

MAX_TURN_RATE public_oe static_oe property

The maximum turning rate of the robot, in degrees, which is 10 degress/turn. Note, that the turn rate of the robot depends on it's velocity. MAX_TURN_RATE_RADIANS GetTurnRate(double) GetTurnRateRadians(double)
public static double MAX_TURN_RATE
return double

MAX_TURN_RATE_RADIANS public_oe static_oe property

The maximum turning rate of the robot measured in radians instead of degrees. MAX_TURN_RATE GetTurnRate(double) GetTurnRateRadians(double)
public static double MAX_TURN_RATE_RADIANS
return double

MAX_VELOCITY public_oe static_oe property

The maximum velocity of a robot, which is 8 pixels/turn.
public static double MAX_VELOCITY
return double

MIN_BULLET_POWER public_oe static_oe property

The minimum bullet power, i.e the amount of energy required for firing a bullet, which is 0.1 energy points.
public static double MIN_BULLET_POWER
return double

RADAR_SCAN_RADIUS public_oe static_oe property

The radar scan radius, which is 1200 pixels. Robots which is more than 1200 pixels away cannot be seen on the radar.
public static double RADAR_SCAN_RADIUS
return double

RADAR_TURN_RATE public_oe static_oe property

The turning rate of the radar measured in degrees, which is 45 degrees/turn. Note, that if AdjustRadarForRobotTurn = true and/or AdjustRadarForGunTurn = true has been set, the radar turn is independent of the robot and/or gun turn. If both properties hava been set to true, the radar moves relatively to the screen.

If AdjustRadarForRobotTurn = false and/or AdjustRadarForGunTurn = false have been set or not set at all (this is the default), then the radar turn is dependent on the robot and/or gun turn, and in this case the radar moves relatively to the gun and/or robot body. RADAR_TURN_RATE_RADIANS Robot.IsAdjustGunForRobotTurn Robot.IsAdjustRadarForGunTurn

public static double RADAR_TURN_RATE
return double

RADAR_TURN_RATE_RADIANS public_oe static_oe property

The turning rate of the radar measured in radians instead of degrees. RADAR_TURN_RATE
public static double RADAR_TURN_RATE_RADIANS
return double

ROBOT_HIT_BONUS public_oe static_oe property

The amount of bonus given when a robot moving forward hits an opponent robot (ramming), which is 1.2 energy points.
public static double ROBOT_HIT_BONUS
return double

ROBOT_HIT_DAMAGE public_oe static_oe property

The amount of damage taken when a robot hits or is hit by another robot, which is 0.6 energy points.
public static double ROBOT_HIT_DAMAGE
return double