/[enigma]/enigma/src/lua.cc
ViewVC logotype

Diff of /enigma/src/lua.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by ant_39, Sat Jun 21 18:37:53 2003 UTC revision 1.14 by reallysoft, Fri Jul 11 11:02:23 2003 UTC
# Line 337  get_ticks(lua_State *L) Line 337  get_ticks(lua_State *L)
337      return 1;      return 1;
338  }  }
339    
340    static int
341    en_add_scramble(lua_State *L)
342    {
343        int         x       = int(lua_tonumber(L, 1));
344        int         y       = int(lua_tonumber(L, 2));
345        const char *dir     = lua_tostring(L,3);
346        const char *allowed = "wsen";
347        char       *found   = strchr(allowed, dir[0]);
348    
349        if (found && found[0]) {
350            world::AddScramble(GridPos(x,y), enigma::Direction(found-allowed));
351        }
352        else {
353            lua_error(L, "AddScramble: Third argument must be one character of \"wsen\"");
354        }
355    
356        return 0;
357    }
358    
359    static int
360    en_set_scramble_intensity(lua_State *L)
361    {
362        world::SetScrambleIntensity(int(lua_tonumber(L, 1)));
363        return 0;
364    }
365    
366  static CFunction luafuncs[] = {  static CFunction luafuncs[] = {
367      {en_set_attrib,         "SetAttrib"},      {en_set_attrib,         "SetAttrib"},
368      {en_get_attrib,         "GetAttrib"},      {en_get_attrib,         "GetAttrib"},
# Line 355  static CFunction luafuncs[] = { Line 381  static CFunction luafuncs[] = {
381      {add_rubber_band,       "AddRubberBand"},      {add_rubber_band,       "AddRubberBand"},
382      {lua::FindDataFile,     "FindDataFile"},      {lua::FindDataFile,     "FindDataFile"},
383      {get_ticks,             "GetTicks"},      {get_ticks,             "GetTicks"},
384        {en_add_scramble,       "AddScramble"},
385        {en_set_scramble_intensity, "SetScrambleIntensity"},
386      {0,0}      {0,0}
387  };  };
388    

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26