Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

VB.NET - Mutliple Inheritance

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex C. Barberi - 02 Mar 2006 15:51 GMT
Okay say I was writing a game engine and it had two parts: The actual engine
and a map editor. Both the engine and the editor use the same classes to
store the information about the AI through a DLL so that I can use
Serialization. Now here's my problem: The engine's classes must also inherit
from a DirectX class so that they can be rendered onto the screen. Here is an
example:

(In the DLL)
Public Class myLevel
   Public myVar As Integer
End Class

(In the Engine)
Public Class myRenderingLevel
   Inherits myLevel
   Inherits DX9_RenderClass
End Class

VB.NET doesn't support multiple inheritance, so is there some way I can work
around this without having to copy myLevel's code to myRenderingLevel? Maybe
if I created extra classes...?

Signature

Alex C. Barberi
Chief Executive Officer
VisionForce
http://www.visionforceweb.com

tommaso.gastaldi@uniroma1.it - 02 Mar 2006 18:08 GMT
Hi Alex,

how about nesting a myLevel object within myRenderingLevel? I guess,
you will have an additional dot, but it could actually make clearer
when you are using the "myLevel" properties, methods, etc.:

(In the DLL)
Public Class myLevel
    Public myVar As Integer
   ...
End Class

(In the Engine)
Public Class myRenderingLevel
    Inherits DX9_RenderClass

    Public myLevel as myLevel

End Class

-tom

http://151.100.3.84/TechnicalPreview/

Alex C. Barberi ha scritto:

> Okay say I was writing a game engine and it had two parts: The actual engine
> and a map editor. Both the engine and the editor use the same classes to
[quoted text clipped - 23 lines]
> VisionForce
> http://www.visionforceweb.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.