protected override MutableObject Mutate(MutableObject mutable) { var groupId = GroupId.GetLastKeyValue(mutable); if (groupId == "") { DataShare.Remove(groupId); } foreach (var entry in DiffValue.GetEntries(mutable)) { if (DataShare.ContainsKey(groupId)) { DiffTarget.SetValue( DiffValue.GetValue(entry) + DataShare[groupId], entry); DataShare[groupId] = DiffValue.GetValue(entry) + DataShare[groupId]; } else { DiffTarget.SetValue(DiffValue.GetValue(entry), entry); DataShare[groupId] = DiffValue.GetValue(entry); } } return(mutable); }
protected override MutableObject Mutate(MutableObject mutable) { var groupId = GroupId.GetLastKeyValue(mutable); var index = DataShare.ContainsKey(groupId) ? DataShare[groupId] : 0; if (groupId != "") { DataShare[groupId] = index + 1; } ColorTarget.SetValue(ColorPalette.ColorFromIndex(index), mutable); return(mutable); }