This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: bug in infantry building a base which is already started
- From: Eric McDonald <mcdonald at phy dot cmich dot edu>
- To: Hans Ronne <hronne at comhem dot se>
- Cc: xconq7 at sources dot redhat dot com
- Date: Tue, 25 May 2004 18:27:07 -0400 (EDT)
- Subject: Re: bug in infantry building a base which is already started
On Wed, 26 May 2004, Hans Ronne wrote:
> A followup: the easiest way to fix the build code is of course to iterate
> over units instead of unit views. Since that code is checking that the
> builder and the target is on the same side, the latter will always be fully
> visible to the builder, so there is really no point in using unit views
> here.
I had considered what you suggest. However, one cannot assume that
all units in a cell are on the same side as the builder. And since
this is a task, and not an action-handler, we should not be giving
the task special knowledge about another side's units. If we ever
get to the point where we have a true client-server architecture,
we may regret making such assumptions. This is why I still think
it is better to loop through the unit views, and then retrieve the
actual unit once we know it is on our side. If we loop through
units instead, and compare their sides, then we are, in some
sense, cheating.
Eric
P.S. I understand that with a real client-server architecture, we
would not have direct access to the side's actual units either,
but instead a shadow copy of them. Nonetheless, the above point is
still valid, IMO.