Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @:autoBuild(ComponentID.run()) interface Component {}
- class ComponentID {
- public static function run() {
- var fields = Context.getBuildFields();
- // add static '_component_id' field to the objects static fields
- return fields;
- }
- }
- class ComponentManager {
- macro public static function getType(T:Expr) {
- // convert T into expressing accessing _component_id
- return macro _getType(T'sid);
- }
- static function _getType(id:Int):ComponentType { .. }
- }
Advertisement
Add Comment
Please, Sign In to add comment