Rewrote the baker-family example around a unified story: the annual Harvest Baking Competition is Saturday. Martha's sourdough starter Old Maggie is sluggish from a cold snap, Jane is secretly entering the FreeStyle category, Emma's science fair project is "The Chemistry of Fermentation", Henry is judging for the first time and worried about impartiality, and Roland is defending last year's title. The week's schedules (Mon guild meeting → Tue test bakes → Wed sourcing → Thu dough prep → Fri science fair → Sat competition → Sun recovery) are now fully populated with narrative-specific actions. Files split for composability: - behaviors/baker_behaviors.sb → 5 focused files by character/domain - schema/types.sb → 4 files (core, baking, world, social) - schedules/work_schedules.sb → 4 files (one per schedule) - relationships/baker_family_relationships.sb → family + bakery Strong typing: replaced all enumerable string fields with concepts (BakerSpecialty, Occupation, LocationType, InstitutionType, ParentingStyle, Intensity, BakeryDomain, BakingDiscipline, ManagementDomain, CompetitiveAdvantage). Remove new-syntax-demo.sb (superseded by baker-family example).
47 lines
1003 B
Plaintext
47 lines
1003 B
Plaintext
//! Life arc definitions for the Baker family
|
|
//!
|
|
//! Demonstrates v0.3.0 life arc features:
|
|
//! - Field requirements with type annotations (requires clause)
|
|
//! - State transitions with conditions
|
|
|
|
// Career progression for bakers
|
|
life_arc BakerCareer requires { baking_skill: Number, work_ethic: Number } {
|
|
state apprentice {
|
|
on enter {
|
|
specialty: Learning
|
|
}
|
|
on baking_skill > 0.5 and work_ethic > 0.7 -> journeyman
|
|
}
|
|
|
|
state journeyman {
|
|
on enter {
|
|
specialty: Bread
|
|
}
|
|
on baking_skill > 0.8 and work_ethic > 0.9 -> master
|
|
}
|
|
|
|
state master {
|
|
on enter {
|
|
specialty: Artisan
|
|
}
|
|
}
|
|
}
|
|
|
|
// Growth arc for children
|
|
life_arc Childhood requires { age: Number, curiosity: Number } {
|
|
state young_child {
|
|
on age > 5 -> school_age
|
|
}
|
|
|
|
state school_age {
|
|
on age > 12 -> teenager
|
|
}
|
|
|
|
state teenager {
|
|
on age > 18 -> adult
|
|
}
|
|
|
|
state adult {
|
|
}
|
|
}
|