From: MIGUEL A. B. L. <mb...@fe...> - 2002-06-06 18:36:13
|
Mensaje citado por: Peter Gantner <pet...@un...>: > > Hi! > > I have been pondering about action system. > Miguel said he'd like an object-oriented approach, so I tried. > > I read the wiki docs in code book, and the ADRF-action-definition but > I fear I didn't understand them. > I also could not really figure out what exactly is already on the > code, and how much must e adapte or rewritten to use this model. > > So this might be obselote, or sub-optimal, but to me it seems a > straight-forward and easy system. Problem is that actions are usually much complex that malus/bonus... when I talk about OO actions system I mean that I would like them to have heritance and overload. So we could have a player running Use on a door, with a mobile phone, and a dog. We will have them on C++ on my example this class door: public _whatever_ { ActionResult Use(Script_API*) { if( door is broken) return fail; if( door is open) the close else open; return success; } ... } class mobile_phone: public phone { ... } class phone: public _whatever_ { ActionResult Use(Script_API*) { if( other use on ) { Send data return success; } else { return Call user } } } class dog: public animal { ... } class mamal: public { ActionResult Use(Script_API*) { return fail; } } If you know a bit of C++ you should understand the above... but using this approach will ease a hell the rules coding. |