Trying to use a Java Enum in Jython but I can't figure out how to use them.
when importing I see the enum listed as BotInterface$MOVE
so I've put down the line
from amazebot2012.BotInterface import MOVE
In Java I would normally just use it as
bot.move(MOVE.FORWARD);
bot.move(MOVE.BACKWARD);
What is the Jython equivalent once I've imported it?
Trying bot.move(MOVE.FORWARD)
gives me the error:
Undefined variable from import: FORWARD
Your import and reference seem correct.
I suspect this is a bug in your editing environment, if you're using PyDev/Anapta:
http://jira.appcelerator.org/browse/APSTUD-7502
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With