Encapsulate object-state state tests and setttings in macros.

This isn't a complete refwctoring, just the part than can be done with
transparetly correct capture of inlinre logic into macros.

No logic changes. Tests pass, 100% coverage.
This commit is contained in:
Eric S. Raymond 2023-04-07 16:11:04 -04:00
parent 9cd7c53d78
commit 02987d0330
7 changed files with 32 additions and 25 deletions

View file

@ -50,7 +50,7 @@ int score(enum termination mode)
k = 16;
if (game.objects[i].prop > STATE_NOTFOUND)
score += 2;
if (game.objects[i].place == LOC_BUILDING && game.objects[i].prop == STATE_FOUND)
if (game.objects[i].place == LOC_BUILDING && PROP_IS_FOUND(i))
score += k - 2;
mxscor += k;
}