Entitas  0.35.0
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Blueprint.cs
1 using System;
2 
3 namespace Entitas.Serialization.Blueprints {
4 
5  [Serializable]
6  public class Blueprint {
7 
8  public string poolIdentifier;
9  public string name;
10  public ComponentBlueprint[] components;
11 
12  public Blueprint() {
13  }
14 
15  public Blueprint(string poolIdentifier, string name, Entity entity) {
16  this.poolIdentifier = poolIdentifier;
17  this.name = name;
18 
19  var allComponents = entity.GetComponents();
20  var componentIndices = entity.GetComponentIndices();
21  components = new ComponentBlueprint[allComponents.Length];
22  for (int i = 0; i < allComponents.Length; i++) {
23  components[i] = new ComponentBlueprint(
24  componentIndices[i], allComponents[i]
25  );
26  }
27  }
28  }
29 }
IComponent [] GetComponents()
Returns all added components.
Definition: Entity.cs:246
int [] GetComponentIndices()
Returns all indices of added components.
Definition: Entity.cs:266