From: Enne W. <enn...@gm...> - 2009-10-31 11:44:07
|
On Sat, Oct 31, 2009 at 7:16 AM, Matthew Cline <zel...@us...> wrote: > via 504d29bc76fbf1f17965a9cc17bb5902a00f2a55 (commit) > from 1eb5294b8716ec5a15a24600919f1a82b10a860f (commit) > > ----------------------------------------------------------------------- > commit 504d29bc76fbf1f17965a9cc17bb5902a00f2a55 > Author: Jude Brown <boo...@us...> > Date: Sat Oct 31 04:15:30 2009 -0700 > > Volcano tweaks, you.where_are_you() > > you.where_are_you dlua binding, further Volcano tweaks. Not to be critical here (because this is neat idea), but it seems weird to expose the value of an enum directly to lua. What happens if we reorder the branches in branch_type or insert something in the middle? Maybe you_where_are_you should return branches[you.where_are_you].abbrevname? That would change the lua from if you.where_are_you() == 2 then ...to... if you.where_are_you() == "Orc" then (One other option is to make the function take the branch name as an argument, e.g. you.in_branch("Orc"). This would allow you to case-insensitively search on the C++ end among branch long names, short names, and abbreviations for the intended branch. It would also let you throw a lua error and fail vault compilation if that branch name didn't exist.) -Enne |