team178 / 2016RobotCmdBased

2 stars 0 forks source link

Use of CommandBase #15

Closed gisellegk closed 8 years ago

gisellegk commented 8 years ago
public class CommandBase extends Command {

<<<<<<< HEAD
    DriveTrain drivetrain = new DriveTrain();
    Encoders encoder = new Encoders();
=======
    DriveTrain drivetrain;
>>>>>>> 51f432dd03f4f093d8a0b1be0a517346e06e801a

    public static OI oi;

...

    // Called just before this Command runs the first time
    protected void initialize() {
        oi = Robot.oi;
        drivetrain = Robot.drivetrain;
    }

Rather than creating an object (eg. new DriveTrain() and new Encoders()) can we stick to only creating the variables, then setting them to Robot.[item name] in initialize()?