Skip to content

Commit 2a3d6a1

Browse files
committed
Renamed update to query.
1 parent 0fabc37 commit 2a3d6a1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Arch.System.Sample/Systems.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ public partial class MovementSystem : BaseSystem<World, GameTime>
1616
private readonly Rectangle _viewport;
1717
public MovementSystem(World world, Rectangle viewport) : base(world) { _viewport = viewport;}
1818

19-
[Update]
19+
[Query]
2020
[MethodImpl(MethodImplOptions.AggressiveInlining)]
2121
public void Move([Data] GameTime time, ref Position pos, ref Velocity vel)
2222
{
2323
pos.Vector2 += time.ElapsedGameTime.Milliseconds * vel.Vector2;
2424
}
2525

26-
[Update]
26+
[Query]
2727
[MethodImpl(MethodImplOptions.AggressiveInlining)]
2828
public void Bounce(ref Position pos, ref Velocity vel)
2929
{
@@ -48,7 +48,7 @@ public partial class ColorSystem : BaseSystem<World, GameTime>
4848
{
4949
public ColorSystem(World world) : base(world) {}
5050

51-
[Update]
51+
[Query]
5252
[MethodImpl(MethodImplOptions.AggressiveInlining)]
5353
public void ChangeColor([Data] GameTime time, ref Sprite sprite)
5454
{
@@ -72,7 +72,7 @@ public override void BeforeUpdate(in GameTime t)
7272
_batch.Begin();
7373
}
7474

75-
[Update]
75+
[Query]
7676
[MethodImpl(MethodImplOptions.AggressiveInlining)]
7777
public void Draw(ref Position position, ref Sprite sprite)
7878
{
@@ -100,7 +100,7 @@ public override void Update(in GameTime t)
100100
PrintEntitiesWithoutVelocityQuery(World); // Call source generated query, which calls the PrintEntitiesWithoutVelocity method
101101
}
102102

103-
[Update]
103+
[Query]
104104
[All<Position, Sprite>, None<Velocity>]
105105
[MethodImpl(MethodImplOptions.AggressiveInlining)]
106106
public void PrintEntitiesWithoutVelocity(in Entity entity)

Arch.System.SourceGenerator/SourceGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace Arch.System.SourceGenerator
3333
// Do a simple filter for methods marked with update
3434
IncrementalValuesProvider<MethodDeclarationSyntax> methodDeclarations = context.SyntaxProvider.CreateSyntaxProvider(
3535
static (s, _) => s is MethodDeclarationSyntax { AttributeLists.Count: > 0 },
36-
static (ctx, _) => GetMethodSymbolIfAttributeof(ctx, "Arch.System.SourceGenerator.UpdateAttribute")
36+
static (ctx, _) => GetMethodSymbolIfAttributeof(ctx, "Arch.System.SourceGenerator.QueryAttribute")
3737
).Where(static m => m is not null)!; // filter out attributed methods that we don't care about
3838

3939
// Combine the selected enums with the `Compilation`

Arch.System/Attributes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/// Marks a method to generate a high performance query for it.
55
/// </summary>
66
[global::System.AttributeUsage(global::System.AttributeTargets.Method)]
7-
public class UpdateAttribute : global::System.Attribute
7+
public class QueryAttribute : global::System.Attribute
88
{
99
}
1010

0 commit comments

Comments
 (0)