Mirror of Svelto.ECS because we're a fan of it
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.
|
- using System;
- using System.Diagnostics;
-
- namespace Svelto.ECS
- {
- sealed class ComponentIDDebugProxy
- {
- public ComponentIDDebugProxy(ComponentID id)
- {
- this._id = id;
- }
-
- public Type type => ComponentTypeMap.FetchType(_id);
-
- readonly ComponentID _id;
- }
-
-
- [DebuggerTypeProxy(typeof(ComponentIDDebugProxy))]
- public struct ComponentID: IEquatable<ComponentID>, IComparable<ComponentID>
- {
- public static implicit operator int(ComponentID id)
- {
- return id._id;
- }
-
- public static implicit operator uint(ComponentID id)
- {
- return (uint)id._id;
- }
-
- public static implicit operator ComponentID(int id)
- {
- return new ComponentID()
- {
- _id = id
- };
- }
-
- public bool Equals(ComponentID other)
- {
- return _id == other._id;
- }
-
- public override int GetHashCode()
- {
- return _id;
- }
-
- public int CompareTo(ComponentID other)
- {
- return _id.CompareTo(other._id);
- }
-
- int _id;
- }
- }
|