It's my first question here so please don't be angry at me if something wrong.
Here is the problem: We have class Node. It's a base class for class Item. So basically:
public class Item extends Node
Ok, still everything is fine. But we also have class let's call it NodeFactory that contains static method loadNodeAssets returning Node as a result.
public static Node loadNodeAssets (String path)
In the library I am using it is only way to initialize Node class and load assets into it. But the main problem is that I need to get Item class instance but not Node. How could I accomplish it?
Item f = (Item)NodeFacory.loadNodeAssets ("...")
Not working since returning class has type Node but not Item. Basically I need to construct Fish class and initialize inherited fields in the Node class which Fish class extending. Sorry for my english. Hope for your help. Thank you!