View Single Post
  #33   Spotlight this post!  
Unread 23-02-2015, 17:50
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: functions for auto

Quote:
Originally Posted by curtis0gj View Post
But I am a bit confused with:

Auto.run(this, autoMethod);
this is still static. Since you now have a constructor and stuff, this should be "autonManager.run...".
To review
Static methods are designated by the "static" keyword, accessed through the classes name itself (ex. "Auto.run"), and do not have accessed to instanced variables and methods
Instaneced methods are designated through the lack of the "static" keyword, accessed through an instance of the class (ex. "autonManager.run..."), and have access to instanced variables and methods.

The specified piece of code is in Robot.autonomousInit. In robot, you have an instance of Auto named "autonManager", yet you attempt to call the instanced method "run" by designating the class "Auto" instead of the instance "autonManager"
Reply With Quote