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).
This commit is contained in:
54
examples/baker-family/behaviors/person_behaviors.sb
Normal file
54
examples/baker-family/behaviors/person_behaviors.sb
Normal file
@@ -0,0 +1,54 @@
|
||||
//! Shared person behaviors — used by all characters via the Person template
|
||||
|
||||
behavior BasicNeeds {
|
||||
repeat {
|
||||
choose {
|
||||
if(self.hunger is hungry) { eat }
|
||||
if(self.hunger is satisfied) { rest }
|
||||
if(self.thirst is thirsty) { drink }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
behavior SocialInteraction {
|
||||
choose {
|
||||
greet_neighbors
|
||||
chat_with_customers
|
||||
family_time
|
||||
}
|
||||
}
|
||||
|
||||
// Generic schedule utility behaviors used across WorkWeek-derived schedules
|
||||
behavior MorningRoutine {
|
||||
then {
|
||||
wake_up
|
||||
eat_breakfast
|
||||
prepare_for_day
|
||||
}
|
||||
}
|
||||
|
||||
behavior DailyWork {
|
||||
then {
|
||||
travel_to_work
|
||||
perform_duties
|
||||
travel_home
|
||||
}
|
||||
}
|
||||
|
||||
behavior Resting {
|
||||
choose {
|
||||
read_book
|
||||
take_nap
|
||||
sit_in_garden
|
||||
}
|
||||
}
|
||||
|
||||
// Sunday recovery — the whole family
|
||||
behavior FamilyBreakfast {
|
||||
then {
|
||||
sleep_in
|
||||
make_breakfast_together
|
||||
eat_together
|
||||
discuss_the_week
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user