public StatsFields CloneAndChangeOwner(IStatsOwner owner) { StatsFields statsFields = new StatsFields(owner); statsFields.Fields = this.Fields.ToDictionary((System.Collections.Generic.KeyValuePair <PlayerFields, StatsData> x) => x.Key, (System.Collections.Generic.KeyValuePair <PlayerFields, StatsData> x) => x.Value.CloneAndChangeOwner(owner)); return(statsFields); }
public void InitializeFromStats(StatsFields fields) { Fields.Clear(); foreach (var field in fields.Fields) { Fields.Add(field.Key, field.Value.CloneAndChangeOwner(Owner)); } }