/// <summary> /// Sets an integer property. If the variation and value are -1, the integer property is deleted. /// </summary> public void SetIntPropValues(int tpt, int nVar, int nVal) { bool delete = nVar == -1 && nVal == -1; if (!delete && tpt == (int)FwTextPropType.ktptWs && nVal <= 0) { throw new ArgumentOutOfRangeException("nVal", "The specified writing system code is invalid."); } if (delete) { IntProperties.Remove(tpt); } else { IntProperties[tpt] = new TsIntPropValue(nVar, nVal); } }
/// <summary> /// This should be called after any postback and/or before any save. due to how we can delete mid-row /// in the UI, properties are only soft-deleted and need to be physically removed here. /// </summary> public void CleanDeletedAndEmptyProperties() { StringProperties?.RemoveAll(x => x == null || x.Deleted || x.Value == null); IntProperties?.RemoveAll(x => x == null || x.Deleted || x.Value == null); Int64Properties?.RemoveAll(x => x == null || x.Deleted || x.Value == null); DoubleProperties?.RemoveAll(x => x == null || x.Deleted || x.Value == null); BoolProperties?.RemoveAll(x => x == null || x.Deleted); DidProperties?.RemoveAll(x => x == null || x.Deleted || x.Value == null); IidProperties?.RemoveAll(x => x == null || x.Deleted || x.Value == null); Spells?.RemoveAll(x => x == null || x.Deleted); BookProperties?.RemoveAll(x => x == null || x.Deleted); Positions?.RemoveAll(x => x == null || x.Deleted); EmoteTable.ForEach(es => es.Emotes.RemoveAll(x => x == null || x.Deleted)); EmoteTable?.RemoveAll(x => x == null || x.Deleted); BodyParts?.RemoveAll(x => x == null || x.Deleted); GeneratorTable?.RemoveAll(x => x == null || x.Deleted); CreateList?.RemoveAll(x => x == null || x.Deleted); Skills.RemoveAll(x => x == null || x.Deleted); if (!HasAbilities) { Abilities = null; } }
internal TsTextProps(int ws) { IntProperties.Add((int)FwTextPropType.ktptWs, new TsIntPropValue((int)FwTextPropVar.ktpvDefault, ws)); }
/// <summary> /// Clears everything from the text properties builder (return to state when just created). /// </summary> public void Clear() { IntProperties.Clear(); StringProperties.Clear(); }