2015-01-11 16:02:49 -05:00
|
|
|
#include "OI.h"
|
2015-02-03 15:55:11 -05:00
|
|
|
#include "Commands/Elevator/Lower.h"
|
|
|
|
#include "Commands/Elevator/Raise.h"
|
|
|
|
#include "Commands/Collector/OpenCollector.h"
|
|
|
|
#include "Commands/Collector/CloseCollector.h"
|
|
|
|
#include "Commands/Collector/CollectTote.h"
|
|
|
|
#include "Commands/Collector/ReleaseTote.h"
|
2015-01-11 16:02:49 -05:00
|
|
|
|
|
|
|
OI::OI() {
|
2015-01-17 12:21:16 -05:00
|
|
|
leftStick=new Joystick(0);
|
|
|
|
rightStick=new Joystick(1);
|
2015-02-02 12:14:27 -05:00
|
|
|
//TODO name these buttons to their functions rather to their number
|
2015-02-04 11:15:21 -05:00
|
|
|
JoystickButton *left1=new JoystickButton(leftStick, 1);
|
|
|
|
JoystickButton *left2=new JoystickButton(leftStick, 2);
|
|
|
|
JoystickButton *left3=new JoystickButton(leftStick, 3);
|
|
|
|
JoystickButton *left4=new JoystickButton(leftStick, 4);
|
|
|
|
JoystickButton *left5=new JoystickButton(leftStick, 5);
|
|
|
|
JoystickButton *left6=new JoystickButton(leftStick, 6);
|
|
|
|
left1->WhileHeld(new OpenCollector());
|
|
|
|
left2->WhileHeld(new CloseCollector());
|
|
|
|
left3->WhileHeld(new CollectTote());
|
|
|
|
left4->WhileHeld(new ReleaseTote());
|
2015-02-07 06:53:41 -05:00
|
|
|
left5->WhenPressed(new Raise());
|
|
|
|
left6->WhenPressed(new Lower());
|
2015-01-17 12:21:16 -05:00
|
|
|
}
|
|
|
|
Joystick* OI::GetRightStick(){
|
|
|
|
return rightStick;
|
|
|
|
}
|
|
|
|
Joystick* OI::GetLeftStick(){
|
|
|
|
return leftStick;
|
2015-01-11 16:02:49 -05:00
|
|
|
}
|