This isn't really about game design, but more of engine design. I feel this is still the best place for it.
My issue is the organization of the object class with my engine. The basic premise is something like this:
Entity --> ShapeEntity --> Object
|-> ImageEntity -|
So, Entity holds a bunch of base attributes of any object. Namely, things like position, velocity, facing angle, etc.
The ShapeEntity and ImageEntity extend this to include functionality specific to each (ie, handling movement/transformations of shapes and images).
The idea is the Object (my own Object class, not Java's Object) will be able to use either the exact same way, while abstracting the underlying Class specific orientation. So, even though the code is different for rotating an Image versus rotating a Shape, Object can simply call rotate() and it work regardless of which Entity subclass it is using.
My approach so far have been an abstract Entity class, the ImageEntity and ShapeEntity subclasses, and the Object class which has an Entity field. This allows for Object to hold either Entity subclasses. But, I'm having trouble actually using this method without having to constantly cast the Entity field to one of the subclasses. That's just messy and over complicates things.
Am I even on the right track with this? Does anyone have any advice or suggestions? Bear in mind this engine is strictly 2D. Thanks in advance.