/// <summary> /// Create a new Portable object. This class is designed specifically to be imported by other solutions. By calling this constructor, /// the class will provide you with a robot which appears on the screen. Calling the methods in this class will change the appearance /// of the robot on screen as well. You can use methods for setting degrees in this class with the normal 360 fashion too. /// Note: you must call "setCameraToListenToKeys" to be able to move the camera with the keyboard. Otherwise the camera /// can't know when to move. /// </summary> /// <param name="viewport">The viewport to use for displaying the robot.</param> public Portable(Viewport3D viewport) { //Now initialise the display! motorManager = new MotorManager(); robot = new Robot(); platform = new ViewPlatform(viewport, motorManager, robot); positionCalculator = new PositionCalculator(robot, motorManager); updateMotors(); }
public Linker(Viewport3D viewport) { //Now initialise the display! motorManager = new MotorManager(); Robot robot = new Robot(); platform = new ViewPlatform(viewport, motorManager, robot); positionCalculator = new PositionCalculator(robot, motorManager); keyController = new KeyInputController(motorManager, positionCalculator); }
/// <summary> /// Create a new Portable object. This class is designed specifically to be imported by other solutions. By calling this constructor, /// the class will provide you with a robot which does not appear on a display, but otherwise works in the same way. /// You can set motor degrees through this class in the normal 360 fashion too. /// </summary> public Portable() { //Now initialise the display! motorManager = new MotorManager(); robot = new Robot(); robot.intialise(new Viewport3D()); //Add myself as a listener for the motor manager: motorManager.addListener(this); platform = new ViewPlatform(new Viewport3D(), motorManager, robot); positionCalculator = new PositionCalculator(robot, motorManager); updateMotors(); }