Last active
October 11, 2015 09:48
-
-
Save mzaks/123bd2cff59cebc5973a to your computer and use it in GitHub Desktop.
Find all Entitas-CSharp Component classes in a Xamarin Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var componentTypes = new HashSet<string>(); | |
| foreach (var type in doc.Compilation.MainAssembly.TopLevelTypeDefinitions){ | |
| foreach (var parentType in type.DirectBaseTypes) { | |
| if (parentType.FullName == "Entitas.IComponent"){ | |
| var name = type.FullName; | |
| if(name.EndsWith("Component")){ | |
| // names should contain component name without Component sufix. | |
| name = name.Substring(0, name.Length - "Component".Length); | |
| } | |
| componentTypes.Add(name); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment