Ejemplo n.º 1
0
        private void ReadConstants()
        {
            int Count = Stream.ReadInt32();
            List <LuaConstant> Consts = new List <LuaConstant>(Count);

            for (int Idx = 0; Idx < Count; Idx++)
            {
                LuaConstantType Type  = (LuaConstantType)Stream.ReadByte();
                LuaConstant     Const = LuaNil;

                if (Type == LuaConstantType.BOOL)
                {
                    Const = Stream.ReadBoolean();
                }
                else if (Type == LuaConstantType.NUMBER)
                {
                    Const = Stream.ReadDouble();
                }
                else if (Type == LuaConstantType.STRING)
                {
                    Const = Stream.ReadCString();
                }

                Consts.Add(Const);
            }

            Proto.Consts = Consts;
        }
Ejemplo n.º 2
0
 public LuaConstant(LuaConstantType T, object Val = null)
 {
     Type  = T;
     Value = Val;
 }