Add tests for reading player data from a saved game

- Changed cPlayer::equip to a bitset
- Use a static constant instead of a loop to initialized player starting spells
- Only save spell points if the player has any (current if different from max)
- Symbolic forms for trait enum (and save symbolic forms also for skills)
- When loading a player, clear data which is not always present in the file
- Also add an init test for cPlayer
This commit is contained in:
2016-09-15 17:25:43 -04:00
parent 8aaa0a24c0
commit 863ac053c4
9 changed files with 242 additions and 33 deletions

View File

@@ -0,0 +1,15 @@
UID 3
STATUS -1 alive
NAME "Freddy O'Hara"
SKILL hp 20
HEALTH 18
EXPERIENCE 12
SKILLPTS 3
LEVEL 2
STATUS web 3
TRAIT ambidex
TRAIT nimble
TRAIT bad-back
ICON 3
RACE human
DIRECTION e

View File

@@ -0,0 +1,9 @@
SKILL str 5
SKILL dex 6
SKILL int 3
SKILL hp 20
SKILL edged 3
SKILL traps 2
SKILL item-lore 1
SKILL lockpick 2
SKILL luck 1

View File

@@ -0,0 +1,6 @@
MAGE 3
MAGE 7
MAGE 20
PRIEST 2
PRIEST 8
PRIEST 60