RE: JESS: [EXTERNAL] Access public enum inside of a class

2011-12-07 Thread Friedman-Hill, Ernest
Nested enums, like nested classes, actually secretly have a name like 
"UnitType$UnitTypes". I haven't tried this specifically for enums, but I 
suspect this would work:

engine.executeCommand("(import eisbot.proxy.types.UnitType$UnitTypes)");


From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Hunter McMillen
Sent: Wednesday, December 07, 2011 4:27 PM
To: jess-users
Subject: JESS: [EXTERNAL] Access public enum inside of a class

Hi everyone,

I am trying to use an enum from one of my Java classes inside of Jess. I read a 
forum post that said I could use the (import ) feature to import 
enums into Jess, but that only seems to work when the enum is itself in a 
separate file.

I have a class called UnitType, inside of it there is a public enum called 
UnitTypes where all of the UnitTypes in my game are listed. In Java to access 
this I would use UnitType.UnitTypes. to get to the enum

JESS: [EXTERNAL] Access public enum inside of a class

2011-12-07 Thread Hunter McMillen
Hi everyone,

I am trying to use an enum from one of my Java classes inside of Jess. I
read a forum post that said I could use the (import ) feature to
import enums into Jess, but that only seems to work when the enum is itself
in a separate file.

I have a class called UnitType, inside of it there is a public enum called
UnitTypes where all of the UnitTypes in my game are listed. In Java to
access this I would use UnitType.UnitTypes. to get to the
enum.

When I try this in Jess however, I get an error:
*Rete engine = new Rete();*
*engine.executeCommand("(import eisbot.proxy.types.UnitType.UnitTypes)");*

an error occurs,* "java.lang.ClassNotFoundException:
eisbot.proxy.types.UnitType.UnitTypes"*

I am curious as to how I could go about accessing an enum that is inside of
a Java class from Jess.

any help would be appreciated.

Thanks
Hunter McMillen