| | 1 | | using KernelConfigurationTypes; |
| | 2 | | using System; |
| | 3 | | using System.Collections.Generic; |
| | 4 | |
|
| | 5 | | [Serializable] |
| | 6 | | public class KernelConfigModel |
| | 7 | | { |
| 15 | 8 | | public Features features = new Features(); |
| 15 | 9 | | public Comms comms = new Comms(); |
| 15 | 10 | | public Profiles profiles = new Profiles(); |
| | 11 | | public bool gifSupported = false; |
| 15 | 12 | | public string network = "mainnet"; |
| 15 | 13 | | public List<WorldRange> validWorldRanges = new List<WorldRange>(); |
| | 14 | |
|
| | 15 | | public bool Equals(KernelConfigModel other) |
| | 16 | | { |
| 7 | 17 | | if (other == null) |
| 0 | 18 | | return false; |
| | 19 | |
|
| 7 | 20 | | if (validWorldRanges.Count != other.validWorldRanges.Count) |
| 2 | 21 | | return false; |
| | 22 | |
|
| 12 | 23 | | for (var i = 0; i < validWorldRanges.Count; i++) |
| | 24 | | { |
| 1 | 25 | | if (!validWorldRanges[i].Equals(other.validWorldRanges[i])) |
| 0 | 26 | | return false; |
| | 27 | | } |
| | 28 | |
|
| 5 | 29 | | return this.comms.Equals(other.comms) && |
| | 30 | | this.profiles.Equals(other.profiles) && |
| | 31 | | this.features.Equals(other.features) && |
| | 32 | | this.gifSupported == other.gifSupported && |
| | 33 | | this.network == other.network; |
| | 34 | | } |
| | 35 | |
|
| | 36 | | public KernelConfigModel Clone() |
| | 37 | | { |
| | 38 | | // NOTE: We need to use deep clone |
| 2 | 39 | | KernelConfigModel clone = new KernelConfigModel(); |
| 2 | 40 | | clone.comms = comms.Clone(); |
| 2 | 41 | | clone.profiles = profiles.Clone(); |
| 2 | 42 | | clone.features = features.Clone(); |
| 2 | 43 | | clone.gifSupported = gifSupported; |
| 2 | 44 | | clone.network = network; |
| 2 | 45 | | clone.validWorldRanges = new List<WorldRange>(validWorldRanges); |
| 2 | 46 | | return clone; |
| | 47 | | } |
| | 48 | | } |