Пример #1
0
        public void                     AddProperty(BS_PropertyId id, float value = float.MinValue)
        {
            BS_Property ip = new BS_Property();

            ip.BaseValue = value;
            ip.Id        = id;
            ip.Recompute();
            _properties.Add(id, ip);
            _propertyList.Add(ip);
        }
Пример #2
0
        public void                     RemoveProperty(BS_PropertyId id)
        {
            BS_Property prop = GetProperty(id);

            if (prop != null)
            {
                _propertyList.Remove(prop);
            }

            _properties.Remove(id);
        }
Пример #3
0
        public void                     RemovePropertyKeywords(BS_PropertyId id, BS_KeywordSet flags)
        {
            BS_Property prop = GetProperty(id);

            if (Dbg.Assert(prop != null))
            {
                return;
            }

            prop.Flags.Remove(flags);
            prop.Recompute();
        }
Пример #4
0
        public void                     AddPropertyKeyword(BS_PropertyId id, BS_Keyword flags)
        {
            BS_Property prop = GetProperty(id);

            if (Dbg.Assert(prop != null))
            {
                return;
            }

            prop.Flags.Add(flags);
            prop.Recompute();
        }
Пример #5
0
        public void                     SetPropertyBase(BS_PropertyId id, float value)
        {
            BS_Property prop = GetProperty(id);

            if (Dbg.Assert(prop != null))
            {
                return;
            }

            prop.BaseValue = value;
            prop.Recompute();
        }
Пример #6
0
        public BS_Property              GetProperty(BS_PropertyId id)
        {
            BS_Property p  = null;
            bool        ok = _properties.TryGetValue(id, out p);

            if (Dbg.Assert(ok, "Failed to find property " + id))
            {
                return(null);
            }

            return(p);
        }
Пример #7
0
        public float                    GetCurValue(BS_PropertyId id)
        {
            BS_Property p = GetProperty(id);

            return(p != null ? p.CurValue : float.MinValue);
        }