private void AddComplexTaskButton() { const int followWallBeaconId = 3; var lineState = new UntilBeaconDecorator( new FollowingLineState(), followWallBeaconId, null); var wallState = new UntilLineAppearsDecorator( new FollowingWallOnLeftState(turnSpeed: 5), lineState); lineState.Follower = wallState; ButtonCommands.Add(new CommandButton("Task2", Brain, lineState)); }
private void AddBeaconAccelerationTaskButton() { const int accelerationBeaconId = 3; const int decelerationBeaconId = 1; var followSlowly = new FollowingLineState(4); var followFaster = new FollowingLineState(6); var slowState = new UntilBeaconDecorator( followSlowly, accelerationBeaconId, null); var fastState = new UntilBeaconDecorator( followFaster, decelerationBeaconId, slowState); slowState.Follower = fastState; ButtonCommands.Add(new CommandButton("Task1", Brain, slowState)); }