public Blueprint Save(int entityId) { AttributeTable attributeTable = new AttributeTable(); List <Type> componentTypes = new List <Type>(); // Get all components. foreach (ComponentManager componentManager in this.componentManagers.Values) { IEntityComponent entityComponent = componentManager.GetComponent(entityId); if (entityComponent == null) { continue; } componentTypes.Add(entityComponent.GetType()); InspectorUtils.SaveToAttributeTable(this, entityComponent, attributeTable); } Blueprint blueprint = new Blueprint { AttributeTable = attributeTable, ComponentTypes = componentTypes }; return(blueprint); }