-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
area:dxDeveloper experienceDeveloper experiencecode-review-findingIssue identified from automated code reviewIssue identified from automated code reviewpriority:p1High priorityHigh prioritytype:bugBug fixBug fix
Description
Summary
The Multiplayer sample uses direct float comparison instead of the recommended FloatExtensions methods, violating CLAUDE.md guidelines and teaching anti-patterns.
Source: Code Review #682 (SAMPLE-1)
Location
samples/KeenEyes.Sample.Multiplayer/Components.cs:36-46
// CURRENT (lines 36-46):
public readonly uint GetDirtyMask(in Position baseline)
{
uint mask = 0;
if (MathF.Abs(X - baseline.X) > 0.001f) // ❌ Direct float comparison
{
mask |= 1;
}
// ...
}
// SHOULD BE:
using KeenEyes.Common;
public readonly uint GetDirtyMask(in Position baseline)
{
uint mask = 0;
if (!X.ApproximatelyEquals(baseline.X))
{
mask |= 1;
}
// ...
}Impact
- CLAUDE.md explicitly states "Never use
==to compare floats" - Sample code teaches anti-patterns that users will copy
- Inconsistent with other samples that use the extension methods
Priority
HIGH - Sample code quality affects all users learning from the codebase.
Metadata
Metadata
Assignees
Labels
area:dxDeveloper experienceDeveloper experiencecode-review-findingIssue identified from automated code reviewIssue identified from automated code reviewpriority:p1High priorityHigh prioritytype:bugBug fixBug fix