diff --git a/Artemis_XNA_INDEPENDENT/ComponentType.cs b/Artemis_XNA_INDEPENDENT/ComponentType.cs index d724776..a987974 100644 --- a/Artemis_XNA_INDEPENDENT/ComponentType.cs +++ b/Artemis_XNA_INDEPENDENT/ComponentType.cs @@ -38,6 +38,7 @@ namespace Artemis { #region Using statements + using global::System.Diagnostics; #if XBOX || WINDOWS_PHONE || PORTABLE || FORCEINT32 using BigInteger = global::System.Int32; #else @@ -49,26 +50,30 @@ namespace Artemis #endregion Using statements /// Represents a Component Type. + [DebuggerDisplay("Id:{Id}, Bit:{Bit}")] public sealed class ComponentType { - /// The bit. - private static BigInteger bit; + /// The bit next instance of the class will get. + private static BigInteger nextBit; - /// The id. - private static int id; + /// The id next instance of the class will get. + private static int nextId; /// Initializes static members of the class. static ComponentType() { - bit = 1; - id = 0; + nextBit = 1; + nextId = 0; } /// Initializes a new instance of the class. internal ComponentType() { - this.Id = NextId; - this.Bit = NextBit; + this.Id = nextId; + this.Bit = nextBit; + + nextId++; + nextBit <<= 1; } /// Gets the bit index that represents this type of component. @@ -78,25 +83,6 @@ internal ComponentType() /// Gets the bit that represents this type of component. /// The bit. public BigInteger Bit { get; private set; } - - /// Gets the next id. - /// The next id. - internal static int NextId - { - get { return id++; } - } - - /// Gets the next bit. - /// The next bit. - internal static BigInteger NextBit - { - get - { - BigInteger value = bit; - bit <<= 1; - return value; - } - } } /// The component type class.