Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Bug Passing variables to classes returned by successTask() and failureTask()

Joined
Feb 23, 2019
Messages
34
Is there a way to pass variables with the class returned by successTask() and failureTask()? For example, let's say we have the following method:

Code:
@Override
public TreeTask failureTask() {
    return layTrapAtCoord;
}

To promote composition over inheritance, I would prefer to reuse the layTrapAtCoord method with 5 different coordinates. Is there a way to pass it a Coordinate variable with the class rather than develop 5 different classes each doing the same exact process but on different coordinates?
 
Top