[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Stealth



On 07.04.2005 23:32, Jonathan Koren wrote:
> On Wed, 6 Apr 2005, Jens Granseuer wrote:
> > On 05.04.2005 18:59, Jonathan Koren wrote:
> >> On Sat, 2 Apr 2005, Jens Granseuer wrote:
> > You can currently select a minimum unit class and a maximum unit class.
> > So you can make it all classes from infantry to aircraft inclusive
> > (there's tanks and the like in between). You cannot, however, say
> > infantry and aircraft and nothing else. That's not a bug but a
> > limitation imposed by design (although not necessarily with good
> > reason).
> 
> I would then hold that it is a bug against the design.  I haven't looked 
> at the code, but from what you said, you seem to imply each unit has an 
> integer type id.  The ids have been assigned sequentally to the different 
> unit types.  Th building code just checks a range of unit types and allows 
> only units whose type id falls in that range to enter.
> 
> Assuming I my understanding is correct, wouldn't it make more sense to 
> conver these ids to use some sort of bitmask?  Say the low bits identify
> individual units (i.e. medium tank, aa tank, heavy tank) and the high bits 
> indicate a broad unit class (i.e. tank, boat, aircraft, artillery, train, 
> person)?  You can still use ran the range code if you want, but a bbetter 
> sollution would be to match the unit type against the unit class bitmask.
> 
> What do you think?

Yes, I guess you're right. A bitmask would indeed be a better solution.
I don't like the idea of selecting individual units, though, because
it would be almost certainly more confusing than helpful. In general,
a shop should be accessible by any unit. There may be reasonable
exceptions like air fields or ports but the unit choices for those
should be obvious, and it quickly gets murky if you select individual
units.

> >> Stealth is the ability of a unit to remain hidden from opposing forces