Commit Graph

10 Commits

Author SHA1 Message Date
Glenn Maynard cd8f1fc1c6 "I made this"
lua_replace -> lua_remove
2006-09-30 21:55:31 +00:00
Glenn Maynard 2baddd84fc COMPILE_ASSERT XToString table sizes
pull out common XToString code
simplify XToString
2006-09-27 04:19:47 +00:00
Glenn Maynard f567a0fd28 cleanup arg order 2006-09-26 08:54:54 +00:00
Glenn Maynard 3d79319c04 Register Lua enum types as strings, not numbers.
- Even though these strings are in the context of the table, we still prefix them
   with the enum name ("UnlockRequirement_ArcadePoints", not "ArcadePoints").  The typical
   use is as a simple string (obj:Call("Type")), not as an index into the table, and
   this makes the type clear and easy to search for in that case.
 - no "NUM_UnlockRequirement"; use #UnlockRequirement.
 - no UnlockRequirement_Invalid; use nil
 - Enum<X>::Check always returns a valid X; no additional error checking is
   needed and Lua code can no longer introduce invalid enum values into C
 - This does not support enum types with holes; neither does FOREACH.
 - This is typesafe.  If you give "GAME_CONTROLLER_1" to a function expecting an
   UnlockRequirement, we can detect the error and show a meaningful error message.
 - Lua strings are always merged, and comparisons are as cheap as integers, so
   this isn't slow (and may be faster).
 - Can iterate: for i,j in ipairs(UnlockEntry) do func(j) end
   (This is a bit clumsy; probably want a foreach() iterator that doesn't return i)
 - ThemeMetric<UnlockRequirement> just works.
2006-09-26 01:41:40 +00:00
Glenn Maynard 664a4944fd remove unused 2006-02-02 08:51:28 +00:00
Chris Danford 7f821e8cfc CString -> RString 2006-01-22 01:00:06 +00:00
Chris Danford fc18dbd342 make more strings localizable 2006-01-08 18:40:20 +00:00
Chris Danford dc35d10ee4 move our CStirng into a namespace to fix conflict with MFC 2005-12-09 19:15:31 +00:00
Glenn Maynard 2cab5c4689 license updates 2004-05-31 22:42:12 +00:00
Chris Danford 08d952c9c4 add helper enum class 2004-04-07 20:50:24 +00:00