Skip to content

Commit

Permalink
🐛 Point all transforms to same id
Browse files Browse the repository at this point in the history
  • Loading branch information
heytherewill committed Oct 12, 2023
1 parent 67ac566 commit 4215979
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/Bang.Generator/Templating/Templates.ComponentTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ public ComponentIdSubstitution() : base("<component_id_list>") { }
// This is mostly so hot reload is happy whenever we add more components to the project.
// If this is ever a problem, we can revisit this.
protected override string ProcessComponent(TypeMetadata.Component metadata)
=> $"""
/// <summary>
/// Unique Id used for the lookup of components with type <see cref="{metadata.FullyQualifiedName}"/>.
/// </summary>
public static int {metadata.FriendlyName} => global::Bang.{ParentProjectPrefix}ComponentsLookup.{ParentProjectPrefix}NextLookupId + {metadata.Index};
{
var id = metadata.IsTransformComponent
? "global::Bang.Entities.BangComponentTypes.Transform"
: $"global::Bang.{ParentProjectPrefix}ComponentsLookup.{ParentProjectPrefix}NextLookupId + {metadata.Index}";

""";
return $"""
/// <summary>
/// Unique Id used for the lookup of components with type <see cref="{metadata.FullyQualifiedName}"/>.
/// </summary>
public static int {metadata.FriendlyName} => {id};
""";
}
}
}

0 comments on commit 4215979

Please sign in to comment.