예제 #1
0
        static void Main(string[] args)
        {
            //BitArray
            Bit16 bitsa = new Bit16(1);
            Bit16 bitsb = new Bit16(2);
            Bit16 bitsc = new Bit16(3);
            Bit16 bitsd = new Bit16(65535);

            Bit32 bitse = new Bit32(1229812);

            var aa = bitse.GetByte(0);
            var bb = bitse.GetByte(1);
            var cc = bitse.GetByte(2);
            var dd = bitse.GetByte(3);

            Bit8 bitsf = new Bit8(0B_11000011);

            Bit64 bitsg = new Bit64(UInt64.MaxValue - 1);

            bitsf[0] = true;
            bitsf[1] = true;
            bitsf[2] = true;
            bitsf[3] = true;
            bitsf[4] = true;
            bitsf[5] = true;
            bitsf[6] = true;
            bitsf[7] = true;

            bitsf[4] = false;

            bitsd[3] = false;
        }
예제 #2
0
        public static void Initialize(ILuaEnvironment env)
        {
            LuaLibraries libraries = env.Settings.Libraries;

            if ((libraries & LuaLibraries.Standard) == LuaLibraries.Standard)
            {
                Standard.Initialize(env);
            }
            if ((libraries & LuaLibraries.IO) == LuaLibraries.IO)
            {
                IO.Initialize(env);
            }
            if ((libraries & LuaLibraries.String) == LuaLibraries.String)
            {
                String.Initialize(env);
            }
            if ((libraries & LuaLibraries.Math) == LuaLibraries.Math)
            {
                Math.Initialize(env);
                Bit32.Initialize(env);
            }
            if ((libraries & LuaLibraries.Table) == LuaLibraries.Table)
            {
                new Table(env).Initialize();
            }
            if ((libraries & LuaLibraries.OS) == LuaLibraries.OS)
            {
                new OS(env).Initialize();
            }
            if ((libraries & LuaLibraries.Modules) == LuaLibraries.Modules)
            {
                new Module(env).Initialize();
            }
            if ((libraries & LuaLibraries.Coroutine) == LuaLibraries.Coroutine)
            {
                new Coroutine(env).Initialize();
            }
        }