View Single Post
  #1   Spotlight this post!  
Unread 22-03-2013, 21:51
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
Anonymous functions

I want to do something like this

Code:
private ExtendedBoolean b = new ExtendedBoolean(){return m_pressed};
private void run()
    if(b){
        motor.set(1);
    }
}
but the only way i can do it now is

Code:
private ExtendedBoolean b = new ExtendedBoolean(){private boolean get() return m_pressed;};
private void run()
    if(b.get()){
        motor.set(1);
    }
}
which just looks ugly in my opinion. Is there a good way to do it?
Reply With Quote