add Def{} helper.
(This uses the debug API. This particular use seems OK, but maybe should be abstracted.)
This commit is contained in:
@@ -10,6 +10,15 @@ PLAYER_1 = "PlayerNumber_P1"
|
||||
PLAYER_2 = "PlayerNumber_P2"
|
||||
NUM_PLAYERS = #PlayerNumber
|
||||
|
||||
function string:find_last( text )
|
||||
local LastPos = 0;
|
||||
while true do
|
||||
local p = string.find( self, text, LastPos+1, true );
|
||||
if not p then return LastPos end
|
||||
LastPos = p;
|
||||
end
|
||||
end
|
||||
|
||||
-- (c) 2006 Glenn Maynard
|
||||
-- All rights reserved.
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user