|
From: Cpt. B. <cpt...@te...> - 2003-12-31 04:19:13
|
Why have the arbitrary distinction between crafts and combat units? An
Intercepter would have two carrierContainers for weapons....just assign them
a size(you could even scale it to match a soldier...a backpack is 4x6 or so,
so a hardpoint would be 8x20), and (for v1,at least) just make sure that all
craft weapons match that size.
That way both versions would function the same way...and it leaves it open
in the future to have limits on what craft weapons fit which craft (similar
to Apocalypse).
-The Captain
-----Original Message-----
From: xen...@li...
[mailto:xen...@li...]On Behalf Of
red...@pr...
Sent: Tuesday, December 30, 2003 7:57 PM
To: xen...@li...
Subject: RE: [Xenocide-programming] Carriable Items on Xenocide
Hi mamutas and all,
How about this. We have ICarriable for objects that can be carried, and
ICarrier
for those that can carry. In that way we can make a nice system, suppose
this:
class ICarriable
{};
class ICarrier
{};
class Soldier : public ICarrier
{};
class Aircraft : public ICarrier
{};
ICarrier should be able to present a simple but unified view for carrying
items.
For instance Aircraft's dont mind the size of the stuff you put on them as
long
as the weight do pass over an specified ammount. On the other side Soldiers
do
mind the real proportions and the specific place in where you put them. That
makes the interface pretty difficult. One solution is to think that carriers
have containers, and those containers specify the limits on size. However,
the
carrier itself specify the limit on weight. You can either enumerate the
containers or give them a symbolic name (like "righthand" or "backpack" ) to
be
accesible from a scripting language. So for instance to move the rocket
launcher
from the backpack to the hand you do the following.
ICarrierContainer* backpack = this->getCarrierContainer ("backpack");
// Get the object via its code or whatever.
ICarriable* object = backpack->takeoutObject ( ... );
ICarrierContainer* hand = this->getCarrierContainer ("righthand");
if (hand->isEmpty ())
{
// The ... is the parameters to specify how to add them, I must say
// that I dont have a clue how to specify those parameters to unify both
// types of carrier objects.
hand->addObject (object, ... );
}
else // we dont do anything, or rollback the action :D ;
Other solution is to have different type of interfaces and that those use
the
same type of ICarriable objects (as we have now), one is IStore (where
position
in the store is not relevant, only total size or weight and the other is
ICarrier (used to be called Wearable) where not only size and weight are
relevant but position too.
Any though will be welcomed, cause I am stuck on this.
Greetings
Red Knight
Quoting Mamutas Plaukotas <ma...@pr...>:
> Here is what I think:
>
> We need two interfaces (sorry, but I cannot come up with good names :( )
> 1) IsCarryable (the item which can be carried). That is an 'Ability'
> interface which defines that the object can be carried, for example
weapons
> or corpses. Some objects cannot be carried, like phones, dishes, food
items,
> etc., although they are small enough, but there is no need to carry them.
> 2) AbleToCarry (an object which can carry objects implemented IsCarryable
> interfaces). Those could be aircrafts, units, general store facilities,
etc.
> That interface will be 'Behaviour' in my opinion.
>
> Regards,
> mamutas
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Xenocide-programming mailing list
Xen...@li...
https://lists.sourceforge.net/lists/listinfo/xenocide-programming
|