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.

33 lines
634B

  1. namespace Svelto.ECS
  2. {
  3. public interface INode
  4. {}
  5. public interface INodeWithID:INode
  6. {
  7. int ID { get; }
  8. }
  9. public interface IStructNodeWithID : INode
  10. {
  11. short ID { get; set; }
  12. }
  13. public interface IGroupedStructNodeWithID : IStructNodeWithID
  14. {
  15. short groupID { get; set; }
  16. }
  17. public class NodeWithID: INodeWithID
  18. {
  19. public static TNodeType BuildNode<TNodeType>(int ID) where TNodeType: NodeWithID, new()
  20. {
  21. return new TNodeType { _ID = ID };
  22. }
  23. public int ID { get { return _ID; } }
  24. protected int _ID;
  25. }
  26. }