Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » FreeStars » Design Delimma
Re: Design Delima Mon, 16 June 2003 20:42 Go to previous messageGo to previous message
boneandrew is currently offline boneandrew

 
Crewman 1st Class

Messages: 35
Registered: June 2003
Location: Detroit
I'm a bit rusty with my coding skills right now, but as I understand it, Java is basically C++ with direct control over pointers removed. And actually, I think dealing with classes/inheritance issues is easier with Java. But yes, any of this stuff is possible with C++.

There are quite a few ways of handling this, actually. Another option would be to define each component as an object that directly adjusts the ship's capabilities. For example, you define the Croby Sharmor as an object that will only fit into shield slots (or shield/elec/mech, whatever), and whenever Stars! accesses the ship, it calls each object and the Croby Sharmor adds the 65 shields and 60 armor per object. (Such objects actually contain executionable code, not just data.) No other condition checking needed. You'd need to define each component, but this will make it VERY easy to design those MT trader parts and other components that have multiple abilities (for example, pen scanners).

Or, if you're really worried about saving memory space, do a condition check on the type of component in each slot and call an appropriate procedure that similarly adds the required armor/shields/whatever. This'll take up less memory space as you're not storing separate exectuionable code in active memory for each component for each ship, but more coding as you'll need to define all the condition checks and stuff. And it'll probably be a little slower.

Anyway, some ideas that I hope help.


[Updated on: Mon, 16 June 2003 20:43]

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:16:38 EDT 2024