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); }
public void RemoveProperty(BS_PropertyId id) { BS_Property prop = GetProperty(id); if (prop != null) { _propertyList.Remove(prop); } _properties.Remove(id); }
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(); }
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(); }
public void SetPropertyBase(BS_PropertyId id, float value) { BS_Property prop = GetProperty(id); if (Dbg.Assert(prop != null)) { return; } prop.BaseValue = value; prop.Recompute(); }
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); }
public float GetCurValue(BS_PropertyId id) { BS_Property p = GetProperty(id); return(p != null ? p.CurValue : float.MinValue); }