Class Bot
Abstract bot class provides convenient methods for movement, turning, and firing the gun. Most bots should inherit from this class.
Inherited Members
Namespace: Robocode.TankRoyale.BotApi
Assembly: api.dll
Syntax
[PublicAPI]
public abstract class Bot : BaseBot, IBot, IBaseBot
Constructors
| Edit this page View SourceBot()
Declaration
protected Bot()
Bot(BotInfo)
Declaration
protected Bot(BotInfo botInfo)
Parameters
Type | Name | Description |
---|---|---|
BotInfo | botInfo |
Bot(BotInfo, Uri)
Declaration
protected Bot(BotInfo botInfo, Uri serverUrl)
Parameters
Type | Name | Description |
---|---|---|
BotInfo | botInfo | |
Uri | serverUrl |
Bot(BotInfo, Uri, string)
Declaration
protected Bot(BotInfo botInfo, Uri serverUrl, string serverSecret)
Parameters
Type | Name | Description |
---|---|---|
BotInfo | botInfo | |
Uri | serverUrl | |
string | serverSecret |
Properties
| Edit this page View SourceDistanceRemaining
The distance remaining till the bot has finished moving after having called SetForward(double), SetBack(double), Forward(double), or Back(double) When the distance remaining has reached 0, the bot has finished its current move.
When the distance remaining is positive, the bot is moving forward. When the distance remaining is negative, the bot is moving backward.
Declaration
public double DistanceRemaining { get; }
Property Value
Type | Description |
---|---|
double | The remaining distance to move before its current movement is completed. If PositiveInfinity the bot will move forward infinitely. If NegativeInfinity the bot will move backward infinitely. |
See Also
| Edit this page View SourceGunTurnRate
Sets or get the turn rate of the gun, which can be positive and negative. The gun turn rate is measured in degrees per turn. The turn rate is added to the current turn direction of the gun. But it is also added to the current direction of the radar. This is because the radar is mounted on the gun, and hence moves with the gun. You can compensate for the turn rate of the gun by subtracting the turn rate of the gun from the turn rate of the radar. But be aware that the turn limits defined for the radar cannot be exceeded.
The gun turn rate is truncated to MaxGunTurnRate if the gun turn rate exceeds this value.
If this property is set multiple times, the last value set before Go() counts.
Declaration
public override double GunTurnRate { set; }
Property Value
Type | Description |
---|---|
double | The turn rate of the gun. |
Overrides
See Also
| Edit this page View SourceGunTurnRemaining
The remaining turn in degrees till the gun has finished turning after having called SetTurnGunLeft(double), SetTurnGunRight(double), TurnGunLeft(double), or TurnGunRight(double)". When the turn remaining has reached 0, the gun has finished turning.
When the turn remaining is positive, the bot is turning to the left (along the unit circle). When the turn remaining is negative, the bot is turning to the right.
Declaration
public double GunTurnRemaining { get; }
Property Value
Type | Description |
---|---|
double | The remaining degrees to turn the gun before its current turning is completed. If PositiveInfinity the gun will turn left infinitely. If NegativeInfinity the gun will turn right infinitely. |
See Also
| Edit this page View SourceIsRunning
Checks if this bot is running.
Declaration
public bool IsRunning { get; }
Property Value
Type | Description |
---|---|
bool |
|
RadarTurnRate
Sets or get the turn rate of the radar, which can be positive and negative. The radar turn rate is measured in degrees per turn. The turn rate is added to the current direction of the radar. Note that besides the turn rate of the radar, the turn rates of the bot and gun are also added to the radar direction, as the radar moves with the gun, which is mounted on the gun that moves with the body. You can compensate for the turn rate of the gun by subtracting the turn rate of the bot and gun from the turn rate of the radar. But be aware that the turn limits defined for the radar cannot be exceeded.
The radar turn rate is truncated to MaxRadarTurnRate if the radar turn rate exceeds this value.
If this property is set multiple times, the last value set before Go() counts.
Declaration
public override double RadarTurnRate { set; }
Property Value
Type | Description |
---|---|
double | The turn rate of the radar. |
Overrides
See Also
| Edit this page View SourceRadarTurnRemaining
The remaining turn in degrees till the radar has finished turning after having called SetTurnRadarLeft(double), SetTurnRadarRight(double), TurnRadarLeft(double), or TurnRadarRight(double). When the turn remaining has reached 0, the radar has finished turning.
When the turn remaining is positive, the bot is turning to the left (along the unit circle). When the turn remaining is negative, the bot is turning to the right.
Declaration
public double RadarTurnRemaining { get; }
Property Value
Type | Description |
---|---|
double | The remaining degrees to turn the radar before its current turning is completed. If PositiveInfinity the radar will turn left infinitely. If NegativeInfinity the radar will turn right infinitely. |
See Also
| Edit this page View SourceTargetSpeed
Sets or get the target speed for the bot in units per turn. The target speed is the speed you want to achieve eventually, which could take one to several turns depending on the current speed. For example, if the bot is moving forward with max speed, and then must change to move backward at full speed, the bot will have to first decelerate/brake its positive speed (moving forward). When passing speed of zero, it will then have to accelerate back to achieve max negative speed.
note
Acceleration is 1 unit per turn and deceleration/braking is faster than acceleration as it is -2 unit per turn. Deceleration is negative as it is added to the speed and hence needs to be negative when slowing down.
note
The target speed is truncated to MaxSpeed if the target speed exceeds this value.
If this property is set multiple times, the last value set before Go() counts.
Declaration
public double TargetSpeed { get; set; }
Property Value
Type | Description |
---|---|
double | The target speed. |
TurnRate
Sets or get the turn rate of the bot, which can be positive and negative. The turn rate is measured in degrees per turn. The turn rate is added to the current direction of the bot. But it is also added to the current direction of the gun and radar. This is because the gun is mounted on the body, and hence turns with the body. The radar is mounted on the gun and hence moves with the gun. You can compensate for the turn rate of the bot by subtracting the turn rate of the bot from the turn rate of the gun and radar. But be aware that the turn limits defined for the gun and radar cannot be exceeded.
The turn rate is truncated to MaxTurnRate if the turn rate exceeds this value.
If this property is set multiple times, the last value set before Go() counts.
Declaration
public override double TurnRate { set; }
Property Value
Type | Description |
---|---|
double | The turn rate of the bot |
Overrides
See Also
| Edit this page View SourceTurnRemaining
The remaining turn in degrees till the bot has finished turning after having called SetTurnLeft(double), SetTurnRight(double), TurnLeft(double), or TurnRight(double). When the turn remaining has reached 0, the bot has finished turning.
When the turn remaining is positive, the bot is turning to the left (along the unit circle). When the turn remaining is negative, the bot is turning to the right.
Declaration
public double TurnRemaining { get; }
Property Value
Type | Description |
---|---|
double | The remaining degrees to turn before its current turning is completed. If PositiveInfinity the bot will turn left infinitely. If NegativeInfinity the bot will turn right infinitely. |
See Also
Methods
| Edit this page View SourceBack(double)
Moves the bot backward until it has traveled a specific distance from its current position, or it is moving into an obstacle. The speed is limited by MaxSpeed.
When the bot is moving forward, the Acceleration determines the acceleration of the bot that adds 1 additional unit to the speed per turn while accelerating. However, the bot is faster at braking. The Deceleration determines the deceleration of the bot that subtracts 2 units from the speed per turn.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
This method will cancel the effect of prior calls to TargetSpeed, SetForward(double), and SetBack(double) methods.
Declaration
public void Back(double distance)
Parameters
Type | Name | Description |
---|---|---|
double | distance | Is the distance to move backward. If negative, the bot will move forward. If PositiveInfinity the bot will move backward infinitely. If NegativeInfinity the bot will move forward infinitely. |
See Also
| Edit this page View SourceFire(double)
Fire the gun in the direction as the gun is pointing.
note
Your bot is spending energy when firing a bullet, the amount of energy used for firing the bullet is taken from the bot. The amount of energy loss is equal to the firepower.
If the bullet hits an opponent bot, you will gain energy from the bullet hit. When hitting another bot, your bot will be rewarded and retrieve an energy boost of 3x firepower.
The gun will only fire when the firepower is at MinFirepower or higher. If the firepower is more than MaxFirepower, the power will be truncated to the MaxFirepower.
Whenever the gun is fired, the gun is heated and needs to cool down before it can fire again. The gun heat must be zero before the gun can fire (see GunHeat. The gun heat generated by firing the gun is 1 + (firepower / 5). Hence, the more firepower used the longer it takes to cool down the gun. The gun cooling rate can be read from GunCoolingRate.
The amount of energy used for firing the gun is subtracted from the bot´s total energy. The amount of damage dealt by a bullet hitting another bot is 4x firepower, and if the firepower is greater than 1 it will do an additional 2 x (firepower - 1) damage.
The firepower is truncated to MinFirepower and MaxFirepower if the firepower exceeds these values.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
This method will cancel the effect of prior calls to setting SetFire(double).
Declaration
public void Fire(double firepower)
Parameters
Type | Name | Description |
---|---|---|
double | firepower | Is the amount of energy spent on firing the gun. You cannot spend more energy than available from the bot. The bullet power must be > MinFirepower. |
See Also
| Edit this page View SourceForward(double)
Moves the bot forward until it has traveled a specific distance from its current position, or it is moving into an obstacle. The speed is limited by MaxSpeed.
When the bot is moving forward, the Acceleration determine the acceleration of the bot that adds 1 additional unit to the speed per turn while accelerating. However, the bot is faster at braking. The Deceleration determines the deceleration of the bot that subtracts 2 units from the speed per turn.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
This method will cancel the effect of prior calls to TargetSpeed, SetForward(double), and SetBack(double) methods.
Declaration
public void Forward(double distance)
Parameters
Type | Name | Description |
---|---|---|
double | distance | Is the distance to move forward. If negative, the bot will move backward. If PositiveInfinity the bot will move forward infinitely. If NegativeInfinity the bot will move backward infinitely. |
See Also
| Edit this page View SourceRescan()
Scan (again) with the radar. This method is useful if the radar has not been turning and thereby will not be able to automatically scan bots. This method is useful when the bot movement has stopped, e.g. when Stop() has been called. The last radar direction and sweep angle will be used for rescanning for bots.
Declaration
public void Rescan()
See Also
Resume()
Resume the movement prior to calling the SetStop() or Stop() method. This method has no effect, if it has already been called.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
Declaration
public void Resume()
See Also
| Edit this page View SourceRun()
The Run() method is used for running a program for the bot like:
public void Run()
{
while (IsRunning)
{
Forward(100);
TurnGunLeft(360);
Back(100);
TurnGunRight(360);
}
}
note
The program runs in a loop in this example (as long as the bot is running), meaning that it will start moving forward as soon as TurnGunRight(double) has executed.
When running a loop that could potentially run forever. The best practice is to check if the bot is still running to stop and exit the loop. This gives the game a chance of stopping the thread running the loop in the code behind. If the thread is not stopped correctly, the bot may behave strangely in new rounds.
Declaration
public virtual void Run()
See Also
| Edit this page View SourceSetBack(double)
Set the bot to move backward until it has traveled a specific distance from its current position, or it is moving into an obstacle. The speed is limited by MaxSpeed
When the bot is moving forward, the Acceleration determines the acceleration of the bot that adds 1 additional unit to the speed per turn while accelerating. However, the bot is faster at braking. The Deceleration determines the deceleration of the bot that subtracts 2 units from the speed per turn.
This method will first be executed when Go() is called making it possible to call other set methods before execution. This makes it possible to set the bot to move, turn the body, radar, gun, and also fire the gun in parallel in a single turn when calling Go(). But notice that this is only possible to execute multiple methods in parallel by using setter methods only prior to calling Go().
If this method is called multiple times, the last call before Go() is executed, counts.
This method will cancel the effect of prior setting TargetSpeed as the SetForward(double) and SetBack(double) methods sets the TargetSpeed for each turn until DistanceRemaining reaches 0.
Declaration
public void SetBack(double distance)
Parameters
Type | Name | Description |
---|---|---|
double | distance | Is the distance to move backward. If negative, the bot will move forward. If PositiveInfinity the bot will move backward infinitely. If NegativeInfinity the bot will move forward infinitely. |
See Also
| Edit this page View SourceSetForward(double)
Set the bot to move forward until it has traveled a specific distance from its current position, or it is moving into an obstacle. The speed is limited by MaxSpeed.
When the bot is moving forward, the Acceleration determines the acceleration of the bot that adds 1 additional unit to the speed per turn while accelerating. However, the bot is faster at braking. The Deceleration determines the deceleration of the bot that subtracts 2 units from the speed per turn.
This method will first be executed when Go() is called making it possible to call other set methods before execution. This makes it possible to set the bot to move, turn the body, radar, gun, and also fire the gun in parallel in a single turn when calling Go(). But notice that this is only possible to execute multiple methods in parallel by using setter methods only prior to calling Go().
If this method is called multiple times, the last call before Go() is executed, counts.
This method will cancel the effect of prior setting TargetSpeed as the SetForward(double) and SetBack(double) methods sets the TargetSpeed for each turn until DistanceRemaining reaches 0.
Declaration
public void SetForward(double distance)
Parameters
Type | Name | Description |
---|---|---|
double | distance | Is the distance to move forward. If negative, the bot will move backward. If PositiveInfinity the bot will move forward infinitely. If NegativeInfinity the bot will move backward infinitely. |
See Also
| Edit this page View SourceSetTurnGunLeft(double)
Set the gun to turn to the left (following the increasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when GunTurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxGunTurnRate.
This method will first be executed when Go() is called making it possible to call other set methods before execution. This makes it possible to set the bot to move, turn the body, radar, gun, and also fire the gun in parallel in a single turn when calling Go(). But notice that this is only possible to execute multiple methods in parallel by using setter methods only prior to calling Go().
If this method is called multiple times, the last call before Go() is executed, counts.
This method will cancel the effect of prior calls to SetTurnGunRight(double).
Declaration
public void SetTurnGunLeft(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn left. If negative, the gun will turn right. If PositiveInfinity the gun will turn left infinitely. If NegativeInfinity the gun will turn right infinitely. |
See Also
| Edit this page View SourceSetTurnGunRight(double)
Set the gun to turn to the right (following the decreasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when GunTurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxGunTurnRate.
This method will first be executed when Go() is called making it possible to call other set methods before execution. This makes it possible to set the bot to move, turn the body, radar, gun, and also fire the gun in parallel in a single turn when calling Go(). But notice that this is only possible to execute multiple methods in parallel by using setter methods only prior to calling Go().
If this method is called multiple times, the last call before Go() is executed, counts.
This method will cancel the effect of prior calls to SetTurnGunLeft(double).
Declaration
public void SetTurnGunRight(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn right. If negative, the gun will turn left. If PositiveInfinity the gun will turn right infinitely. If NegativeInfinity the gun will turn left infinitely. |
See Also
| Edit this page View SourceSetTurnLeft(double)
Set the bot to turn to the left (following the increasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when TurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxTurnRate.
This method will first be executed when Go() is called making it possible to call other set methods before execution. This makes it possible to set the bot to move, turn the body, radar, gun, and also fire the gun in parallel in a single turn when calling Go(). But notice that this is only possible to execute multiple methods in parallel by using setter methods only prior to calling Go().
If this method is called multiple times, the last call before Go() is executed, counts.
This method will cancel the effect of prior calls to SetTurnRight(double).
Declaration
public void SetTurnLeft(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn left. If negative, the bot will turn right. If PositiveInfinity the bot will turn left infinitely. If NegativeInfinity the bot will turn right infinitely. |
See Also
| Edit this page View SourceSetTurnRadarLeft(double)
Set the radar to turn to the left (following the increasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when RadarTurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxRadarTurnRate.
This method will first be executed when Go() is called making it possible to call other set methods before execution. This makes it possible to set the bot to move, turn the body, radar, gun, and also fire the gun in parallel in a single turn when calling Go(). But notice that this is only possible to execute multiple methods in parallel by using setter methods only prior to calling Go().
If this method is called multiple times, the last call before Go() is executed, counts.
This method will cancel the effect of prior calls to SetTurnRadarRight(double).
Declaration
public void SetTurnRadarLeft(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn left. If negative, the radar will turn right. If PositiveInfinity the radar will turn left infinitely. If NegativeInfinity the radar will turn right infinitely. |
See Also
SetTurnRadarRight(double)
Turn the radar to the right (following the decreasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when RadarTurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxRadarTurnRate.
This method will first be executed when Go() is called making it possible to call other set methods before execution. This makes it possible to set the bot to move, turn the body, radar, gun, and also fire the gun in parallel in a single turn when calling Go(). But notice that this is only possible to execute multiple methods in parallel by using setter methods only prior to calling Go().
If this method is called multiple times, the last call before Go() is executed, counts.
This method will cancel the effect of prior calls to SetTurnRadarLeft(double) and SetTurnRadarRight(double).
Declaration
public void SetTurnRadarRight(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn right. If negative, the radar will turn left. If PositiveInfinity the radar will turn right infinitely. If NegativeInfinity the radar will turn left infinitely. |
See Also
SetTurnRight(double)
Set the bot to turn to the right (following the decreasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when TurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxTurnRate.
This method will first be executed when Go() is called making it possible to call other set methods before execution. This makes it possible to set the bot to move, turn the body, radar, gun, and also fire the gun in parallel in a single turn when calling Go(). But notice that this is only possible to execute multiple methods in parallel by using setter methods only prior to calling Go().
If this method is called multiple times, the last call before Go() is executed, counts.
This method will cancel the effect of prior calls to SetTurnLeft(double).
Declaration
public void SetTurnRight(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn right. If negative, the bot will turn left. If PositiveInfinity the bot will turn right infinitely. If NegativeInfinity the bot will turn left infinitely. |
See Also
| Edit this page View SourceStop()
Stop all movement including turning the gun and radar. The remaining movement is saved for a call to SetResume() or Resume(). This method has no effect, if it has already been called.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
Declaration
public void Stop()
See Also
| Edit this page View SourceStop(bool)
Stop all movement including turning the gun and radar. The remaining movement is saved for a call to SetResume() or Resume().
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
Declaration
public void Stop(bool overwrite)
Parameters
Type | Name | Description |
---|---|---|
bool | overwrite | overwrite is set to |
See Also
| Edit this page View SourceTurnGunLeft(double)
Turn the gun to the left (following the increasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when GunTurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxGunTurnRate.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
This method will cancel the effect of prior calls to SetTurnGunLeft(double) and SetTurnGunRight(double)
Declaration
public void TurnGunLeft(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn left. If negative, the gun will turn right. If PositiveInfinity the gun will turn left infinitely. If NegativeInfinity the gun will turn right infinitely. |
See Also
| Edit this page View SourceTurnGunRight(double)
Turn the gun to the right (following the decreasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when GunTurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxGunTurnRate.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
This method will cancel the effect of prior calls to SetTurnGunLeft(double) and SetTurnGunRight(double).
Declaration
public void TurnGunRight(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn right. If negative, the gun will turn left. If PositiveInfinity the gun will turn right infinitely. If NegativeInfinity the gun will turn left infinitely. |
See Also
| Edit this page View SourceTurnLeft(double)
Turn the bot to the left (following the increasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when TurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxTurnRate.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
This method will cancel the effect of prior calls to SetTurnLeft(double) and SetTurnRight(double)
Declaration
public void TurnLeft(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn left. If negative, the bot will turn right. If PositiveInfinity the bot will turn left infinitely. If NegativeInfinity the bot will turn right infinitely. |
See Also
| Edit this page View SourceTurnRadarLeft(double)
Turn the radar to the left (following the increasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when RadarTurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxRadarTurnRate.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
This method will cancel the effect of prior calls to SetTurnRadarLeft(double) and SetTurnRadarRight(double).
Declaration
public void TurnRadarLeft(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn left. If negative, the radar will turn right. If PositiveInfinity the radar will turn left infinitely. If NegativeInfinity the radar will turn right infinitely. |
See Also
TurnRadarRight(double)
Turn the radar to the right (following the increasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when RadarTurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxRadarTurnRate.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
This method will cancel the effect of prior calls to SetTurnRadarLeft(double) and SetTurnRadarRight(double).
Declaration
public void TurnRadarRight(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn right. If negative, the radar will turn left. If PositiveInfinity the radar will turn right infinitely. If NegativeInfinity the radar will turn left infinitely. |
See Also
TurnRight(double)
Turn the bot to the right (following the increasing degrees of the unit circle) until it turned the specified amount of degrees. That is, when TurnRemaining is 0. The amount of degrees to turn each turn is limited by MaxTurnRate.
This call is executed immediately by calling Go() in the code behind. This method will block until it has been completed, which can take one to several turns. New commands will first take place after this method is completed. If you need to execute multiple commands in parallel, use setter methods instead of this blocking method.
This method will cancel the effect of prior calls to SetTurnLeft(double) and SetTurnRight(double)
Declaration
public void TurnRight(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Is the amount of degrees to turn right. If negative, the bot will turn left. If PositiveInfinity the bot will turn right infinitely. If NegativeInfinity the bot will turn left infinitely. |
See Also
| Edit this page View SourceWaitFor(Condition)
Blocks until a condition is met, i.e. when a Test() returns true
.
Declaration
public void WaitFor(Condition condition)
Parameters
Type | Name | Description |
---|---|---|
Condition | condition |