Ian
01-02-2007, 02:54 AM
Of course anyone making a game can use their own stylistic conventions in Lua, but were someone to write something that is harmonious with the standard library it would be nice to know what your (Seth's) naming conventions are.
It looks like functions are WrittenLikeThis and everything else (parameters, locals, and so on) is writtenLikeThis, except for internally used constants.
Also, I am writing some methods like Item:OnEquip that returns false if the item cannot be equipped, thus causing Character:Equip to fail. Do you think this right, or should I have a separate function for that? (OnPreEquip, CanEquip, etc.) (OnPostEquip is called after the item is successfully equipped.)
It looks like functions are WrittenLikeThis and everything else (parameters, locals, and so on) is writtenLikeThis, except for internally used constants.
Also, I am writing some methods like Item:OnEquip that returns false if the item cannot be equipped, thus causing Character:Equip to fail. Do you think this right, or should I have a separate function for that? (OnPreEquip, CanEquip, etc.) (OnPostEquip is called after the item is successfully equipped.)