fix(creation-draft): delete the duplicate SPEND_POOL const
CreationDraft's docstring promised it owns no rules—it delegates to NewGame.validate. But it kept a local const POOL := 3 that mirrored NewGame.SPEND_POOL, inviting silent disagreement if the source was changed and the copy forgotten. Delete POOL. Use NewGame.SPEND_POOL directly in points_left(), with a comment making it clear this is the single authority. The coupling is now enforced by code structure, not by hope. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,6 @@ extends RefCounted
|
||||
## inside construct off the same seed, immediately after MAG, and never surfaces.
|
||||
|
||||
const NewGame = preload("res://scripts/newgame/new_game.gd")
|
||||
const POOL := 3 # mirrors NewGame.SPEND_POOL; validate() is the authority
|
||||
|
||||
var name: String = ""
|
||||
var race_id: String = ""
|
||||
@@ -65,7 +64,10 @@ func spent_total() -> int:
|
||||
|
||||
|
||||
func points_left() -> int:
|
||||
return POOL - spent_total()
|
||||
## NewGame.SPEND_POOL is the ONE authority on the pool's size. A local copy of the
|
||||
## number would be a second thing to keep in sync, and this class's whole contract
|
||||
## is that it keeps none.
|
||||
return NewGame.SPEND_POOL - spent_total()
|
||||
|
||||
|
||||
func can_increment(stat: String) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user