View Single Post
  #8   Spotlight this post!  
Unread 20-02-2015, 23:11
curtis0gj curtis0gj is offline
Registered User
FRC #5033 (Beavertronics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Canada
Posts: 121
curtis0gj will become famous soon enough
Re: functions for auto

Quote:
Originally Posted by Arhowk View Post
Something like this

Code:
static Robot r
public static void setRobot(Robot rob){
    r = rob;
}


//in Robot.java
AutonManager.setRobot(this);
or

Code:
Robot robot
public AutonManager(Robot r){
    this.robot =r;
}

//in Robot.java
AutonManager autonManager;
public void robotInit(){
    autonManager = new AutonManager(this);
}
Would this be okay?

Code:
public class Auto {
	
	static Robot r
	public static void setRobot(Robot rob) {
		r = rob;
	}
And when I have this in do I need to put r in front of everything still?
Reply With Quote