Casting classX to classX problem
i am currently writing some extensions To my SmartFoxServer (its used for multi player games etc.)
The software has some classes that both the software and any extensions use (Room and User). the developers have made a map called "properties" where you can store object / variables related to that object. (the map is currently a HashMap)
Now to the problem.
i have created a class that i call Cw2Game and i create a new instance of that object and and add it to the properties map for each game room i create.
i am doing something like this :
Cw2Game game = new Cw2Game ();
Now later when i need that object i try to do something like this:
Cw2Game game = (Cw2Game) gameRoom.properties.get("gameObject");
And this code compiles perfectly fine however on runtime i get the following error:
Exception in ExtensionHandler:
Cannot be cast to
to me this donít make any sense as the error shows that both object and type is the same ?
has anyone had this problem before ? or got any idea on how i may solve it ?
btw i have already tried different approaches with Cw2Game.Class.cast() and obj.getClass()