From: Miguel A. B. L. <mig...@ho...> - 2005-09-09 07:20:38
|
>so here is my problem: > >I cannot add arbitrary attributes to the item because these needs to be >registered in the RPClass: > >marauroa.common.game.RPClass$SyntaxException: attribute attack isn't >defined. > >An item *can* have arbitrary attributes...so either the item manages its >own attribute pool or the RPClass transmits all properties which are not >known as simple visible, volatile Strings. Two solutions: - If attributes are known at compile time just add them all to RPClass. - If attributes are totally arbitrary, just don't define a RPClass for Items. IMHO we can have a basic set of attributes for most items and define an RPClass, special items will surely need a java class because they will have attributes and code to reply to actions ( f.e. a key to open a door with the Use with command, our chest, etc. ). This is really a not urgent task, simply that if propierties are going to be known also at client we better use Attributes to avoid repeating code that may add new ( and exciting! ) bugs. I think that Items situation is a bit different to Creatures, we can do the same approach with types of items: swords, shields, keys,... just my two cents. So, what we do? Regards, Miguel |