|
From: Cpt. B. <cpt...@pr...> - 2004-03-12 06:18:48
|
Here's the breakdown that I'm using in config.items.xml. It's fairly comprehensive for everything that a carriable item needs to do: weapon - carriable, has actions, does damage (eg: pistol, rifle, grenade) autoshot(3-round burst) (range, accuracy, timeunits) snapshot(single round) (range, accuracy, timeunits) aimedshot(single round) (range, accuracy, timeunits) throw (single item) (damage, accuracy, timeunits) touch (hand-to-hand) (damage, accuracy, timeunits) prime (time delay) (range, timeunits) equipment - carriable, has actions (eg: mind probe, motion scanner, ammo) throw (damage, accuracy, timeunits) scan (range, accuracy, timeunits) heal (wound, range, accuracy, timeunits) psi (power, cost, range, accuracy, tiemunits) reload (ammo) (unit, damage, timeunits) -The Captain -----Original Message----- From: xen...@li... [mailto:xen...@li...] On Behalf Of Mamutas Plaukotas Sent: Thursday, March 11, 2004 6:33 PM To: xen...@li... Subject: RE: [Xenocide-programming] datainterfaces update If you want particular set of objects to expose common behavior, then you should create an interface with methods for that behavior and inherit all objects from it. In this case, I think good idea would be to have interface IHandHeld, which will define methods particularly for objects in the person hand. The interface would have methods like: canThrow(), canShoot(), throw(), shoot(), etc. First two methods will let caller know whether the action is available (and actually does something). Second two methods will perform the action itself, if it is applicable to the object (shoot() may not be applicable to knives, so it will have no operation implementation). Does it make sense? Regards, mamutas -----Original Message----- From: Tamas Terpai [mailto:te...@cs...] Sent: Wednesday, March 10, 2004 8:13 AM To: mamutas Subject: Re: [Xenocide-programming] datainterfaces update On Sun, 7 Mar 2004, mamutas wrote: > ICarriable just determines that item can be carried. If you want your item > be able to fire or thrown, then other appropriate interface must be > employed. > And how do I determine which classes did the item in the player's hand inherit? Try to call the appropriate function and catch the exception? I'm sorry, but it's absolutely unclear for me. --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.616 / Virus Database: 395 - Release Date: 3/8/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.616 / Virus Database: 395 - Release Date: 3/8/2004 ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Xenocide-programming mailing list Xen...@li... https://lists.sourceforge.net/lists/listinfo/xenocide-programming |