2019-06-17 18:33:38 +00:00
|
|
|
|
using System;
|
2019-06-13 02:51:36 +00:00
|
|
|
|
|
|
|
|
|
namespace Encompass
|
|
|
|
|
{
|
2019-07-18 21:02:57 +00:00
|
|
|
|
public struct Entity : IEquatable<Entity>
|
2019-06-13 02:51:36 +00:00
|
|
|
|
{
|
2019-07-17 18:24:21 +00:00
|
|
|
|
public readonly Guid ID;
|
2019-06-13 02:51:36 +00:00
|
|
|
|
|
2019-07-17 18:24:21 +00:00
|
|
|
|
internal Entity(Guid id)
|
2019-06-16 01:05:56 +00:00
|
|
|
|
{
|
2019-07-17 18:24:21 +00:00
|
|
|
|
this.ID = id;
|
2019-06-13 02:51:36 +00:00
|
|
|
|
}
|
2019-07-18 21:02:57 +00:00
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
if (obj is Entity)
|
|
|
|
|
{
|
|
|
|
|
return this.Equals((Entity)obj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Equals(Entity other)
|
|
|
|
|
{
|
|
|
|
|
return other.ID == ID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool operator ==(Entity one, Entity two)
|
|
|
|
|
{
|
|
|
|
|
return one.Equals(two);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool operator !=(Entity one, Entity two)
|
|
|
|
|
{
|
|
|
|
|
return !one.Equals(two);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return ID.GetHashCode();
|
|
|
|
|
}
|
2019-06-13 02:51:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|