[Solved]A shorthand question
in
Programming Questions
•
8 months ago
I have a Mob class that is derived from the Atom class. I always loop through atoms and I have a function isMob() to tell if an Atom is a Mob or not. My question is is there any shorthand for being able to reference the mobs vars?
E.G.
E.G.
- class Atom{
- float var1,var2,var3;
- Atom(){}
- Boolean isMob(){return false;}
- }
- class Mob extends Atom{
- float var4,var5;
- Mob(){super();}
- Boolean func1(){return true;}
- Boolean isMob(){return true;}
- }
- setup(){
- Atom atom=new Mob();
- atom<Mob>.func1(); //This doesn't work but is there proper syntax for this or do I have to make a Mob var?
- }
1