Do something like this (I don't remember the exact enum variable names):

if (direction == Ship::Direction::kCounterClockwise) {
    lua_pushstring(L, "ccw")
} elseif ...

then everything will always be referenced by a name.

I have done something similar in lua_map.cc for the BuildingDescription types, 
in case you want to steal some code.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1380287/+merge/252507
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1380287 into lp:widelands.

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to