int luaopen_pycrypto_aes(lua_State *pState) { luaL_Reg reg[] = { {"new", create}, {NULL, NULL} }; luaL_Reg regMeta[] = { {"encrypt", encrypt}, {"decrypt", decrypt}, {NULL, NULL} }; lua_newtable(pState); lua_pushlightuserdata(pState, &pycrypto_aes_key); lua_pushvalue(pState, -2); lua_settable(pState, LUA_REGISTRYINDEX); lua_pushvalue(pState, -1); lua_setfield(pState, -2, "__index"); luaL_register(pState, NULL, regMeta); luaL_register(pState, "pycrypto_aes", reg); lua_pushliteral(pState, VERSION); lua_setfield(pState, -2, "version"); registerMode(pState, MODE_ECB, "MODE_ECB"); registerMode(pState, MODE_CBC, "MODE_CBC"); registerMode(pState, MODE_CFB, "MODE_CFB"); registerMode(pState, MODE_OFB, "MODE_OFB"); return 1; }
/*---------------------------------------------------------------------*//** 作成 **//*---------------------------------------------------------------------*/ bool WalkingMode::create() { if(!GameModeBase::create(GameMode::MODE_GAME_INGAME_WALKING__START_, GameMode::MODE_GAME_INGAME_WALKING__END_, new WalkingRole())) { return false; } // モード登録 registerMode((s16)GameMode::MODE_GAME_INGAME_WALKING_NORMAL, new GameModeBase()); registerMode((s16)GameMode::MODE_GAME_INGAME_WALKING_MAGICTYPING, new MagicTypingMode()); registerMode((s16)GameMode::MODE_GAME_INGAME_WALKING_ITEMUSING, new ItemUsingMode()); return true; }
/*---------------------------------------------------------------------*//** 作成 **//*---------------------------------------------------------------------*/ bool EnemyMode::create(EnemySpirit* sprtRef, EnemyRole* roleEntr) { // ロールを受け取る _role = roleEntr; // 親クラスによる作成 if(!Mode::create(1, _role, true)) { delete _role; _role = 0L; return false; } // 値の初期化 _sprtRef = sprtRef; // モード登録 registerMode((s16)ACT_STANDBY, new Mode()); registerMode((s16)ACT_WALKING, new Mode()); registerMode((s16)ACT_ATTACK, new Mode()); registerMode((s16)ACT_DEFENSE, new Mode()); registerMode((s16)ACT_SKILL, new Mode()); registerMode((s16)ACT_MOVETOTRG, new Mode()); changeMode((s16)ACT_STANDBY, false); return true; }