Files
storybook/examples/baker-family/schema/templates.sb
Sienna Meridian Satterwhite abd54e4c33 feat(examples): rewrite baker-family as coherent Competition Week narrative
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).
2026-02-23 21:51:01 +00:00

42 lines
1.1 KiB
Plaintext

//! Template definitions for the Baker family
//!
//! This example demonstrates v0.3.0 features:
//! - Species-based template inheritance (template Name: Species)
//! - Resource linking (uses_behaviors, uses_schedule)
//! - Template inheritance with include
//! - Multi-level template hierarchies
// Base template for all persons, inheriting from Human species
template Person: Human {
uses behaviors: BasicNeeds, SocialInteraction
age: 0..100
energy: 0.0..1.0
mood: 0.0..1.0
}
// Worker template extends Person
template Worker {
include Person
uses schedule: WorkWeek
occupation: Laborer
work_ethic: 0.5..1.0
}
// Specialized baker template
template Baker {
include Worker
uses behaviors: BakingSkills, CustomerService
uses schedule: BakerSchedule
specialty: Bread
baking_skill: 0.0..1.0
customer_relations: 0.5..1.0
}
// Child template (no work schedule), also inherits from Human species
template Child: Human {
include Person
uses behaviors: PlayBehavior, LearnBehavior
school_grade: 1..12
curiosity: 0.0..1.0
}