I have the following chicken/egg inheritance problem:
Here, base classes I can derive from, but they're on a framework, thus, I can't modify them:
class Editor
{
}
class ScriptedImporterEditor : Editor
{
}
Here, are classes in my project:
An editor with a preview, this works as expected, Cylinder
and Torus
have DrawPreview
:
class EditorWithPreview : Editor
{
public void DrawPreview(){}
}
class Cylinder : EditorWithPreview
{
// DrawPreview is available
}
class Torus : EditorWithPreview
{
// DrawPreview is available
}
But now I need a scripted importer editor that can also preview:
class ScriptedImporterEditorWithPreview : ScriptedImporterEditor
{
// cannot inherit EditorWithPreview as it's not a ScriptedImporterEditor
}
class Cube : ScriptedImporterEditorWithPreview
{
// unable to use DrawPreview
}
class Sphere : ScriptedImporterEditorWithPreview
{
// unable to use DrawPreview
}
So basically,
- I can't change neither
Editor
norScriptedImporterEditor
as I don't own them - I therefore cannot import the logic of
EditorWithPreview
toScriptedImporterEditor
Cube
andSphere
can't inherit and useDrawPreview
Aucun commentaire:
Enregistrer un commentaire