C# Class SLAMBot.Engine.FakeRobot

An in-memory simulated robot.
Inheritance: IRobot
显示文件 Open project: Amichai/SLAM-Code Class Usage Examples

Public Methods

Method Description
FakeRobot ( EnvironmentMap map ) : System

Creates a fake robot that plays in the given map.

Move ( int steps, System.Action callback ) : void

Moves the robot forwards or backwards.

Rotate ( int degrees, System.Action callback ) : void

Rotates the robot in place.

SonarPing ( Action callback ) : void

Sends a SONAR ping.

Step ( ) : void

Runs a single step of the robot's simulation. This method should be called repeatedly.

Teleport ( Location destination ) : void

Instantly teleports the robot to an arbitrary location.

Private Methods

Method Description
MotionIterator ( int steps, System.Action callback ) : IEnumerator
RotationIterator ( int degrees, System.Action callback ) : IEnumerator

Method Details

FakeRobot() public method

Creates a fake robot that plays in the given map.
public FakeRobot ( EnvironmentMap map ) : System
map EnvironmentMap
return System

Move() public method

Moves the robot forwards or backwards.
public Move ( int steps, System.Action callback ) : void
steps int The (signed) number of units to move.
callback System.Action A callback to call when the movement completes.
return void

Rotate() public method

Rotates the robot in place.
public Rotate ( int degrees, System.Action callback ) : void
degrees int The number of degrees to rotate by.
callback System.Action A callback to call when the rotation completes.
return void

SonarPing() public method

Sends a SONAR ping.
public SonarPing ( Action callback ) : void
callback Action
return void

Step() public method

Runs a single step of the robot's simulation. This method should be called repeatedly.
public Step ( ) : void
return void

Teleport() public method

Instantly teleports the robot to an arbitrary location.
public Teleport ( Location destination ) : void
destination Location The location to move to. This location must be unoccupied.
return void