void OnAddCellMapping() { CellMappings.Add(new CellMappingDeclaration() { HighlightColor = TextureParserExtensions.Colors[CellMappings.Count % TextureParserExtensions.Colors.Count] }); }
void OnRemoveCellMapping(CellMappingDeclaration?d) { if (d == null) { return; } CellMappings.Remove(d); }
public bool TryGetCellMapping(string key, [MaybeNullWhen(false)] out CellMappingDeclaration d) { if (cellMappingsByKeyDirty) { cellMappingsByKey.Clear(); foreach (var m in CellMappings.ToArray()) { if (m.Key != null) { cellMappingsByKey[m.Key] = m; } } } return(cellMappingsByKey.TryGetValue(key, out d)); }