Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » FreeStars » Component File Sample (long)
Re: Component File Sample (long) Wed, 10 December 2003 20:37 Go to previous messageGo to previous message
Sotek is currently offline Sotek

 
Chief Warrant Officer 2

Messages: 167
Registered: November 2002
boneandrew wrote on Wed, 10 December 2003 18:24

The tech requirement for "no tech" should be 0, not -1. You can use a simpler data storage. And seeing if something is non-zero is slightly easier to check than seeing if something is positive (for miniturization, for example).


A miniturization option's precisely why it'd be a good idea to use a -1.

What if I want to modify things slightly so that the scout hull miniturizes from const only?

It'd be easy enough to do with -1 tech requirement.

And speaking as a programmer, -1 is a very common value for 'does not exist', and it's nice to be consistant like that...
...and you can't get much simpler data storage than the basic integer, which, I should point out, is a signed variable.

And to check if it's positive?

if (variable > -1 ).

Simple and explicit.

Report message to a moderator

 
Read Message icon10.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
Previous Topic: Battles
Next Topic: Graphics
Goto Forum:
  


Current Time: Tue Jun 04 07:13:19 EDT 2024