Worms4Editor/LibXom/Data/XomFileComponent.cs

33 lines
846 B
C#
Raw Normal View History

2023-01-07 09:36:13 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibXom.Data
{
public class XomFileComponent
{
2023-03-07 07:49:53 +00:00
private Guid guid = Guid.NewGuid();
2023-01-07 09:36:13 +00:00
internal XomFile fileBelongs;
public virtual int Id { get; }
2023-03-07 07:49:53 +00:00
public string Uuid
2023-01-07 09:36:13 +00:00
{
get
{
return guid.ToString();
}
}
2023-03-07 07:49:53 +00:00
public override int GetHashCode()
{
return this.Uuid.GetHashCode();
}
public override bool Equals(object? obj)
{
if (obj is not XomFileComponent) return false;
XomFileComponent xComponent = (obj as XomFileComponent);
return this.Uuid.Equals(xComponent.Uuid, StringComparison.InvariantCultureIgnoreCase);
2023-03-07 07:49:53 +00:00
}
2023-01-07 09:36:13 +00:00
}
}