Пример #1
0
        private StringTable(string name, uint max_entries, bool user_data_fixed_size,
                uint user_data_size, uint user_data_size_bits, MultiFlag flags) {
            this.Name = name;
            this.MaxEntries = max_entries;
            this.UserDataFixedSize = user_data_fixed_size;
            this.UserDataSize = user_data_size;
            this.UserDataSizeBits = user_data_size_bits;
            this.Flags = flags;

            this.EntryBits = Util.Log2(max_entries);
            this.Count = 0;

            this.dict = new Dictionary<string, int>();
            this.entries = new List<Entry>();
        }
Пример #2
0
        private StringTable(string name, uint max_entries, bool user_data_fixed_size,
            uint user_data_size, uint user_data_size_bits, MultiFlag flags)
        {
            Name = name;
            MaxEntries = max_entries;
            UserDataFixedSize = user_data_fixed_size;
            UserDataSize = user_data_size;
            UserDataSizeBits = user_data_size_bits;
            Flags = flags;

            EntryBits = MiscMath.Log2(max_entries);
            Count = 0;

            dict = new Dictionary<string, int>();
            entries = new List<Entry>();
        }
Пример #3
0
        private StringTable(string name, uint max_entries, bool user_data_fixed_size,
                            uint user_data_size, uint user_data_size_bits, MultiFlag flags)
        {
            Name              = name;
            MaxEntries        = max_entries;
            UserDataFixedSize = user_data_fixed_size;
            UserDataSize      = user_data_size;
            UserDataSizeBits  = user_data_size_bits;
            Flags             = flags;

            EntryBits = MiscMath.Log2(max_entries);
            Count     = 0;

            dict    = new Dictionary <string, int>();
            entries = new List <Entry>();
        }
Пример #4
0
        private StringTable(string name, uint max_entries, bool user_data_fixed_size,
                            uint user_data_size, uint user_data_size_bits, MultiFlag flags)
        {
            this.Name              = name;
            this.MaxEntries        = max_entries;
            this.UserDataFixedSize = user_data_fixed_size;
            this.UserDataSize      = user_data_size;
            this.UserDataSizeBits  = user_data_size_bits;
            this.Flags             = flags;

            this.EntryBits = Util.Log2(max_entries);
            this.Count     = 0;

            this.dict    = new Dictionary <string, int>();
            this.entries = new List <Entry>();
        }
Пример #5
0
        public static StringTable Create(CSVCMsg_CreateStringTable proto)
        {
            MultiFlag flags = MultiFlag.None;

            if ((proto.flags & (uint)MultiFlag.Precache) > 0)
            {
                flags |= MultiFlag.Precache;
            }

            if ((proto.flags & (uint)MultiFlag.What) > 0)
            {
                flags |= MultiFlag.What;
            }

            if ((proto.flags & (uint)MultiFlag.FixedLength) > 0)
            {
                flags |= MultiFlag.FixedLength;
            }

            return(new StringTable(proto.name, (uint)proto.max_entries,
                                   proto.user_data_fixed_size, (uint)proto.user_data_size,
                                   (uint)proto.user_data_size_bits, flags));
        }