Entitas  0.35.0
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
PoolAttributesGenerator.cs
1 using System.Linq;
2 
3 namespace Entitas.CodeGenerator {
4 
6 
7  public CodeGenFile[] Generate(string[] poolNames) {
8  return poolNames
9  .Where(poolName => !poolName.IsDefaultPoolName())
10  .Select(poolName => poolName.UppercaseFirst())
11  .Select(poolName => new CodeGenFile(
12  poolName + "Attribute",
13  generatePoolAttributes(poolName),
14  GetType().FullName
15  )).ToArray();
16  }
17 
18  static string generatePoolAttributes(string poolName) {
19  return string.Format(@"using Entitas.CodeGenerator;
20 
21 public class {0}Attribute : PoolAttribute {{
22 
23  public {0}Attribute() : base(""{0}"") {{
24  }}
25 }}
26 
27 ", poolName);
28  }
29  }
30 }