Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » FreeStars » Design Delimma
icon5.gif  Re: Design Delima Mon, 16 June 2003 21:58 Go to previous messageGo to previous message
John Marasco is currently offline John Marasco

 
Crewman 3rd Class

Messages: 5
Registered: June 2003
If it's not too late for suggestions you could define a <component> class that contains an array of <sub component> classes. The <sub component> classes are based on a virtual <basic component> class that provide methods like IsShield, IsArmor, IsComputer, PrimaryValue, SecondaryValue, etc... The <component> class will contain a function to parse the array and return pertinent parameters from the various <sub component> classes. Disk storage could be via XML, which would mirror the in memory structure. The <component> class could even have generic GetArmor, GetShield, GetComputer, GetJamming, GetManeuverJet, etc... methods built into it to parse and find the basic <sub component> variables and then more generic methods for future <sub component> types. You could build all this functionality into the <component> class (like you suggest) which is the equivalent of the multi-inheritance component class. The trouble is that you cannot strip off individual component objects and pass them to other functions unless you actually have "sub components" to strip off.

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Just how flexible?
Next Topic: Planet Transfer
Goto Forum:
  


Current Time: Thu Jul 04 00:38:13 EDT 2024