Rename constants to descriptive names (refactor step 1)
Pure rename, no behavior change; the full suite (RNG goldens,
generation invariants, scripted sessions, save round trip) is
unchanged and green.
- Creature flags: IsHuh→Confused, IsHalu→Hallucinating,
CanHuh→CanConfuse, CanSee→CanSeeInvisible, IsRun→Awake,
SeeMonst→SenseMonsters, IsCanc→Cancelled, IsLevit→Levitating,
IsBlind/IsGreed/IsHaste/IsTarget/IsHeld/IsInvis/IsMean/IsRegen/
IsFly/IsSlow → Blind/Greedy/Hasted/Targeted/Held/Invisible/Mean/
Regenerates/Flying/Slowed, IsFound→Found
- Object flags: IsCursed→Cursed, IsKnow→Known, IsMissl→Missile,
IsMany→Stackable, ObjIsFound→WasFound, IsProt→Protected
- Room flags: IsDark/IsGone/IsMaze → Dark/Gone/Maze; place flags:
FPass→FPassage, FPNum→FPassNum, FTMask→FTrapMask
- Trap types: TDoor→TrapDoor ... TMyst→TrapMystery
- Item subtypes: P*→Potion* (PLSD→PotionLSD, PMFind→
PotionDetectMonsters, ...), S*→Scroll* (SIDRorS→
ScrollIdentifyRingOrStick, ...), R*→Ring* (RAddHit→RingDexterity,
RNop→RingAdornment, ...), Ws*→Wand* (WsElect→WandLightning, ...),
weapons (TwoSword→WeaponTwoHandedSword, Shiraken→WeaponShuriken,
...), armor (RingMail→ArmorRingMail, ...)
- Counts: Max{Potions,Scrolls,Rings,Sticks,Weapons,Armors} →
Num{Potion,Scroll,Ring,Wand,Weapon,Armor}Types; NTraps→NumTrapTypes
- Level.NTraps field → TrapCount (also in the save snapshot)
- Original C constant names preserved as comment breadcrumbs in
types.go so the lineage stays greppable
TODO.md: step 1 moved to Completed, step 2 (typed kinds) promoted to
Next Step.
This commit is contained in:
56
TODO.md
56
TODO.md
@@ -19,19 +19,21 @@ Refactor ground rules:
|
||||
|
||||
# Next Step
|
||||
|
||||
Refactor step 1 (branch refactor/descriptive-constants): rename
|
||||
constants to descriptive, less C-like names. Creature/object/room/place
|
||||
flag bits (IsHuh→Confused, IsHalu→Hallucinating, CanHuh→CanConfuse,
|
||||
SeeMonst→SenseMonsters, ObjIsFound→WasFound, IsCanc→Cancelled, ...),
|
||||
trap types (TMyst→TrapMystery), item subtype constants
|
||||
(PLSD→PotionLSD, SIDRorS→ScrollIdentifyRingOrStick,
|
||||
RAddHit→RingDexterity, WsHasteM→WandHasteMonster,
|
||||
TwoSword→WeaponTwoHandedSword, ...), Max* count constants →
|
||||
Num*Types, and the Level.NTraps field → TrapCount. Pure rename; no
|
||||
behavior change; tests unchanged.
|
||||
Refactor step 2 (branch refactor/typed-kinds): typed kind enums —
|
||||
PotionKind, ScrollKind, RingKind, WandKind, WeaponKind, ArmorKind,
|
||||
TrapKind as iota enums with fmt.Stringer; Object.Which and the ObjInfo
|
||||
tables move to the typed kinds; the object category glyph bytes ('!',
|
||||
'?', ...) become an ObjectKind with a Glyph() method so item category
|
||||
and map character stop sharing one byte namespace.
|
||||
|
||||
# Completed Steps
|
||||
|
||||
- 2026-07-06 Refactor step 1 (refactor/descriptive-constants): renamed
|
||||
all flag bits, trap types, item subtype constants, and Max* counts to
|
||||
descriptive names (IsHuh→Confused, SeeMonst→SenseMonsters,
|
||||
WsHasteM→WandHasteMonster, MaxSticks→NumWandTypes, ...);
|
||||
Level.NTraps→TrapCount; C names kept as comment breadcrumbs. Pure
|
||||
rename, suite green.
|
||||
- 2026-07-06 Made the rgoue branch Go-only: removed C sources and the
|
||||
autoconf/VS build system (they remain on master and modern-rogue),
|
||||
ported the last wizard command (item-probability listing), rewrote
|
||||
@@ -53,58 +55,52 @@ behavior change; tests unchanged.
|
||||
|
||||
# Future Steps
|
||||
|
||||
1. Refactor step 2: typed kind enums — PotionKind, ScrollKind,
|
||||
RingKind, WandKind, WeaponKind, ArmorKind, TrapKind as iota enums
|
||||
with fmt.Stringer; Object.Which and the ObjInfo tables move to the
|
||||
typed kinds; the object category glyph bytes ('!', '?', ...) become
|
||||
an ObjectKind with a Glyph() method so item category and map
|
||||
character stop sharing one byte namespace.
|
||||
2. Refactor step 3: un-overload Object fields — split Object.Arm into
|
||||
1. Refactor step 3: un-overload Object fields — split Object.Arm into
|
||||
ArmorClass/Charges/GoldValue; parse damage dice ("1x4/1x2") once
|
||||
into a DiceSpec type at table definition instead of per swing;
|
||||
save-format update with round-trip test migration.
|
||||
3. Adopt the house Go linting standards: copy .golangci.yml from the
|
||||
2. Adopt the house Go linting standards: copy .golangci.yml from the
|
||||
prompts repo and bring game/, term/, and cmd/ lint-clean (the port
|
||||
is greenfield code, so no exemptions apply).
|
||||
4. Refactor step 4: method renames, movement/world subsystem
|
||||
3. Refactor step 4: method renames, movement/world subsystem
|
||||
(doMove→moveHero, beTrapped→springTrap, rndmove→randomStep,
|
||||
doRooms/doPassages/doMaze→digRooms/digPassages/digMaze,
|
||||
chgStr→changeStrength, ...); remove the goto/label flows in doMove,
|
||||
dispatch, and saveGame in favor of loops and helpers.
|
||||
5. Refactor step 5: method renames, items/combat/UI subsystems
|
||||
4. Refactor step 5: method renames, items/combat/UI subsystems
|
||||
(invName→inventoryName, rollEm→rollAttacks, doPot→applyPotionFuse,
|
||||
getItem→promptPackItem returning (obj, ok), getDir→promptDirection);
|
||||
int status codes (attack returning -1) become named results. Two or
|
||||
three commits, one subsystem each.
|
||||
6. Refactor step 6: extract types from the god object — MessageLine
|
||||
5. Refactor step 6: extract types from the god object — MessageLine
|
||||
owns the msg/addmsg/endmsg machinery; pack/inventory operations move
|
||||
onto *Player; monster/object list management and map queries
|
||||
consolidate onto *Level; RogueGame keeps turn orchestration and
|
||||
cross-system effects only.
|
||||
7. Refactor step 7: effects dispatch — the giant quaff/readScroll/doZap
|
||||
6. Refactor step 7: effects dispatch — the giant quaff/readScroll/doZap
|
||||
switches become per-kind handler tables of small named methods,
|
||||
keeping effect order and RNG call sequence identical.
|
||||
8. Refactor step 8: constructor and style pass per the house
|
||||
7. Refactor step 8: constructor and style pass per the house
|
||||
styleguide — game.New(game.Params{...}) replacing NewGame(Config);
|
||||
replace the gameEnd panic unwind with error-based turn results where
|
||||
feasible; 77-column wrap sweep.
|
||||
9. Docs refresh: update ARCHITECTURE.md Part 2 and README.md for the
|
||||
8. Docs refresh: update ARCHITECTURE.md Part 2 and README.md for the
|
||||
post-refactor names; add the C name → Go name rename table.
|
||||
10. Playtest hardening pass: play several full games with the tcell
|
||||
9. Playtest hardening pass: play several full games with the tcell
|
||||
binary and extend run_test.go to script a deeper multi-level
|
||||
playthrough (descend past level 5, use potions, scrolls, zapping,
|
||||
save/restore). Fix any panics, message mismatches, or divergences
|
||||
from the C behavior that this uncovers, with regression tests.
|
||||
11. Verify the seed-compatibility claim against the C reference on
|
||||
10. Verify the seed-compatibility claim against the C reference on
|
||||
c-master: same seed, same dungeon, same item tables, for several
|
||||
seeds.
|
||||
12. Broaden unit test coverage where playtesting finds thin spots
|
||||
11. Broaden unit test coverage where playtesting finds thin spots
|
||||
(rings, sticks, wizard commands).
|
||||
13. Tag a release once a full game (Amulet retrieval and score entry)
|
||||
12. Tag a release once a full game (Amulet retrieval and score entry)
|
||||
completes without defects.
|
||||
14. Full-terminal-size support (deferred by explicit decision
|
||||
13. Full-terminal-size support (deferred by explicit decision
|
||||
2026-07-06): per-game dungeon dimensions instead of the 80x24
|
||||
constants; open design questions are resize policy, gameplay
|
||||
tuning at larger sizes, and a --classic 80x24 mode.
|
||||
15. Note: this repo is exempt from the standard policy scaffold. Do not
|
||||
14. Note: this repo is exempt from the standard policy scaffold. Do not
|
||||
add Makefile, Dockerfile, or REPO_POLICIES.md.
|
||||
|
||||
Reference in New Issue
Block a user