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:
20
game/save.go
20
game/save.go
@@ -74,14 +74,14 @@ type SaveState struct {
|
||||
HasAmulet bool
|
||||
SeenStairs bool
|
||||
|
||||
Places []savedPlace
|
||||
Rooms [MaxRooms]Room
|
||||
Passages [MaxPass]Room
|
||||
Objects []Object
|
||||
Monsters []savedCreature
|
||||
Dests []destRef // parallel to Monsters
|
||||
Stairs Coord
|
||||
NTraps int
|
||||
Places []savedPlace
|
||||
Rooms [MaxRooms]Room
|
||||
Passages [MaxPass]Room
|
||||
Objects []Object
|
||||
Monsters []savedCreature
|
||||
Dests []destRef // parallel to Monsters
|
||||
Stairs Coord
|
||||
TrapCount int
|
||||
|
||||
After bool
|
||||
Again bool
|
||||
@@ -179,7 +179,7 @@ func (g *RogueGame) snapshot() *SaveState {
|
||||
Rooms: g.Level.Rooms,
|
||||
Passages: g.Level.Passages,
|
||||
Stairs: g.Level.Stairs,
|
||||
NTraps: g.Level.NTraps,
|
||||
TrapCount: g.Level.TrapCount,
|
||||
After: g.After,
|
||||
Again: g.Again,
|
||||
NoScoreF: g.NoScore,
|
||||
@@ -308,7 +308,7 @@ func (g *RogueGame) applySnapshot(st *SaveState) {
|
||||
g.Level.Rooms = st.Rooms
|
||||
g.Level.Passages = st.Passages
|
||||
g.Level.Stairs = st.Stairs
|
||||
g.Level.NTraps = st.NTraps
|
||||
g.Level.TrapCount = st.TrapCount
|
||||
g.After = st.After
|
||||
g.Again = st.Again
|
||||
g.NoScore = st.NoScoreF
|
||||
|
||||
Reference in New Issue
Block a user