コード例 #1
0
        private void SetInitialState()
        {
            State = new NLua.Lua();
            State.LoadCLRPackage();
            State.DoString(@"import ('World','World.ToyWorldCore')");
            State.DoString(@"import ('World','World.Lua')");

            State["le"]    = this;
            State["atlas"] = m_atlas;

            State.RegisterFunction("Help", typeof(LuaExecutor).GetMethod("Help"));

            if (m_atlas.Avatars.Count > 0)
            {
                AvatarCommander avatarCommander = new AvatarCommander(this, m_atlas);
                State["ac"] = avatarCommander;
            }

            AtlasManipulator atlasManipulator = new AtlasManipulator(m_atlas);

            State["am"] = atlasManipulator;

            State["lc"] = m_luaConsole;

            State.DebugHook += OnDebugHook;

            State.SetDebugHook(EventMasks.LUA_MASKLINE, 1000);
        }
コード例 #2
0
 public GameActorPosition GetNearest(string type)
 {
     return(AtlasManipulator.GetNearest((int)m_currentAvatar.Position.X, (int)m_currentAvatar.Position.Y,
                                        type, m_atlas));
 }