[messages] [Module Design] Name problem in piece reporting
jean-yves.moyen at ens-lyon.org
Fri Apr 10 19:19:04 CEST 2015
Being an heavy Prototype and DP user (with a touch of layers), I'm
pretty sure Prototypes do not mess DP and are handled correctly (ie as
abstract classes instanciated for each object inheriting them). And
indeed, I am a strong believer that Prototypes do reduce the risk of
errors by poor copy/paste.
You may, however have an issue with Prototype order since they are
loaded in order and can only affect previously loaded Prototypes.
Concerning overloading command names, you are now allowed (since quite
some time) to give each command a real name and not just the keyboard
shortcut. I suggest to make heavy use of this feature and give your
commands (especially the internal ones not seen by the end users) a long
and explicit name to limit risks. And make your own list in a side text
file if you're afraid of forgetting them…
Make your naming conventions for commands and stick with it (eg
'DoSomething', 'do_something' or 'do.something', do not mix conventions
in a single module). And if you have many aspects in your game, use a
naming convention that allows separate namespaces (usually, prefixes
that tell what the command is related to). For example, Foo.do_something
and Bar.do_something could have a similar effect but on different
aspects of the game.
And I often create 'debug' commands when needed. That's commands that
basically log all the internal values of a piece (eg "pos: $position$ -
HP: $hp$ - " and so on). Sometimes, it is necessarily to use them within
trigger (ie, in your case you can make a trigger command
debug/flip/debug to see what happen with which DP/CP).
Read this topic online here:
More information about the messages