[QUALITY] Replace magic numbers and strings with named constants #19

Open
opened 2026-03-12 00:03:38 +00:00 by lavarius · 0 comments
Owner

🟡 Medium — Code Quality

Magic numbers and strings scattered throughout the codebase make behaviour hard to understand and tune:

  • 0.35f — dissolve threshold in OutfitChanger
  • -2f — gravity reset in SimpleGravity
  • 0.9f — dot product threshold in MovementManager
  • 20000 — dart throw count in GridMapGenerator
  • 50 — max attempts in Radio
  • "Player" — tag string in AutoColliderDoor

Fix: Extract to named const fields or [SerializeField] configurable values:

[SerializeField] private float dissolveThreshold = 0.35f;
private const string PlayerTag = "Player";
## 🟡 Medium — Code Quality Magic numbers and strings scattered throughout the codebase make behaviour hard to understand and tune: - `0.35f` — dissolve threshold in `OutfitChanger` - `-2f` — gravity reset in `SimpleGravity` - `0.9f` — dot product threshold in `MovementManager` - `20000` — dart throw count in `GridMapGenerator` - `50` — max attempts in `Radio` - `"Player"` — tag string in `AutoColliderDoor` **Fix:** Extract to named `const` fields or `[SerializeField]` configurable values: ```csharp [SerializeField] private float dissolveThreshold = 0.35f; private const string PlayerTag = "Player"; ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lavarius/ProjectOverlay#19
No description provided.