feat: finalize with step 5

This commit is contained in:
jonas committed 2026-09-03 23:39:25 +02:00
1 parent 129dd5d8b8
commit aab128b55c
10 files changed
+332 -37

No files matched your search

@@ -10,6 +10,11 @@ type Elsa struct {
*BaseGameEntity
stateMachine *StateMachine[Elsa]
// cooking tracks whether there's already a stew in the oven, so
// CookStew.Enter doesn't put a second one in or send a second
// reminder message to herself.
cooking bool
}
// NewElsa sets up Elsa's state machine: DoHousework is her ordinary,
@@ -40,6 +45,16 @@ func (e *Elsa) FSM() *StateMachine[Elsa] {
return e.stateMachine
}
// Cooking reports whether there's already a stew in the oven.
func (e *Elsa) Cooking() bool {
return e.cooking
}
// SetCooking updates whether there's a stew in the oven.
func (e *Elsa) SetCooking(v bool) {
e.cooking = v
}
// Update satisfies the Entity interface (alongside the ID() method
// borrowed from BaseGameEntity) and just delegates to the state
// machine, same shape as Miner.Update.