Commit b0e7df2
authored
feat: implement basic income and expense tracking foundation for Epic 5.3
Implements foundational components for the economy system to enable daily
expense tracking for NPCs.
Components implemented:
- Wallet component (sealed record) for currency management with Add/Remove
operations and CanAfford validation
- ExpenseDefinition (sealed record) with static Food (2-10 copper) and
Housing (5-50 copper) definitions
- ExpenseType enum for type-safe expense categories (Food, Housing)
- ExpensePaidEvent (sealed record) implementing IGameEvent for transaction
tracking
- DailyExpenses component (readonly record struct) for character expense
quality preferences (0-100 scale)
- Full Character entity integration with both Wallet and DailyExpenses
Test Coverage: 29 new tests (8 Wallet + 8 ExpenseDefinition + 3 ExpensePaidEvent
+ 8 DailyExpenses + 4 Character integration)
All 573 tests passing (485 Core + 88 Simulation)
Zero warnings with --warnaserror
All CI checks passing
This completes Epic 5.3 by providing the foundation for NPC economic
pressure through daily expenses. Future epics will add income sources (5.5)
and system execution (5.6).
Closes #421 parent caf95a8 commit b0e7df2
13 files changed
Lines changed: 1345 additions & 16 deletions
File tree
- docs/plans
- src/FantasyRpgWorld.Core
- Definitions
- Domain
- Components
- Entities
- ValueObjects
- Events
- tests/FantasyRpgWorld.Core.Tests
- Definitions
- Domain
- Components
- Entities
- Events
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| 126 | + | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
137 | 147 | | |
138 | 148 | | |
139 | 149 | | |
| |||
0 commit comments