You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
namespace UnityEditor.ShaderGraph.Serialization |
|
{ |
|
struct MultiJsonEntry |
|
{ |
|
public string id { get; } |
|
public string type { get; } |
|
public string json { get; } |
|
|
|
public MultiJsonEntry(string type, string id, string json) |
|
{ |
|
this.id = id; |
|
this.type = type; |
|
this.json = json; |
|
} |
|
|
|
public bool Equals(MultiJsonEntry other) |
|
{ |
|
return id == other.id && type == other.type && json == other.json; |
|
} |
|
|
|
public override bool Equals(object obj) |
|
{ |
|
return obj is MultiJsonEntry other && Equals(other); |
|
} |
|
|
|
public override int GetHashCode() |
|
{ |
|
unchecked |
|
{ |
|
var hashCode = (id != null ? id.GetHashCode() : 0); |
|
hashCode = (hashCode * 397) ^ (type != null ? type.GetHashCode() : 0); |
|
hashCode = (hashCode * 397) ^ (json != null ? json.GetHashCode() : 0); |
|
return hashCode; |
|
} |
|
} |
|
|
|
public override string ToString() |
|
{ |
|
return $"{nameof(id)}: {id}, {nameof(type)}: {type}, {nameof(json)}:\n{json}"; |
|
} |
|
} |
|
}
|
|
|