JD2022-TU1/main/tools/modules/JD.DjRedo/Core/AudioNodeInfos.cs

54 lines
No EOL
1.4 KiB
C#

using System;
using DjRedo.Core.Trees;
using JD.Serialization;
namespace DjRedo.Core
{
internal struct AudioNodeInfos : IEquatable<AudioNodeInfos>
{
public AudioNode AudioNode
{
get;
set;
}
public LuaSerializer Serializer
{
get;
set;
}
public Actor_Template Tpl
{
get;
set;
}
public static AudioNodeInfos Empty=>new AudioNodeInfos();
/// <inheritdoc />
public bool Equals(AudioNodeInfos other)
{
return Equals(AudioNode, other.AudioNode) && Equals(Serializer, other.Serializer) && Equals(Tpl, other.Tpl);
}
/// <inheritdoc />
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
return obj is AudioNodeInfos && Equals((AudioNodeInfos) obj);
}
/// <inheritdoc />
public override int GetHashCode()
{
unchecked
{
var hashCode = (AudioNode != null ? AudioNode.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (Serializer != null ? Serializer.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (Tpl != null ? Tpl.GetHashCode() : 0);
return hashCode;
}
}
}
}