release: Storybook v0.2.0 - Major syntax and features update
BREAKING CHANGES: - Relationship syntax now requires blocks for all participants - Removed self/other perspective blocks from relationships - Replaced 'guard' keyword with 'if' for behavior tree decorators Language Features: - Add tree-sitter grammar with improved if/condition disambiguation - Add comprehensive tutorial and reference documentation - Add SBIR v0.2.0 binary format specification - Add resource linking system for behaviors and schedules - Add year-long schedule patterns (day, season, recurrence) - Add behavior tree enhancements (named nodes, decorators) Documentation: - Complete tutorial series (9 chapters) with baker family examples - Complete reference documentation for all language features - SBIR v0.2.0 specification with binary format details - Added locations and institutions documentation Examples: - Convert all examples to baker family scenario - Add comprehensive working examples Tooling: - Zed extension with LSP integration - Tree-sitter grammar for syntax highlighting - Build scripts and development tools Version Updates: - Main package: 0.1.0 → 0.2.0 - Tree-sitter grammar: 0.1.0 → 0.2.0 - Zed extension: 0.1.0 → 0.2.0 - Storybook editor: 0.1.0 → 0.2.0
This commit is contained in:
55
examples/baker-family/schedules/work_schedules.sb
Normal file
55
examples/baker-family/schedules/work_schedules.sb
Normal file
@@ -0,0 +1,55 @@
|
||||
//! Work schedules for the Baker family
|
||||
//!
|
||||
//! Demonstrates schedule composition features:
|
||||
//! - extends keyword for schedule inheritance
|
||||
//! - override blocks to modify inherited schedules
|
||||
//! - Named blocks for override system
|
||||
//! - Action references to behavior trees
|
||||
//! - Recurrence patterns for weekly variations
|
||||
|
||||
// Base work schedule (9-5 job)
|
||||
schedule WorkWeek {
|
||||
block morning_prep { 08:00 -> 09:00, action: MorningPrep }
|
||||
block work { 09:00 -> 17:00, action: DailyWork }
|
||||
block evening_rest { 18:00 -> 22:00, action: Resting }
|
||||
}
|
||||
|
||||
// Baker's schedule extends WorkWeek
|
||||
schedule BakerSchedule extends WorkWeek {
|
||||
// Bakers start early - override the work block
|
||||
override work {
|
||||
05:00 -> 13:00
|
||||
action: BakingWork
|
||||
intensity: "high"
|
||||
}
|
||||
|
||||
// Add pre-dawn prep
|
||||
block pre_dawn_prep {
|
||||
04:00 -> 05:00
|
||||
action: PrepKitchen
|
||||
}
|
||||
|
||||
// Market day on Saturdays
|
||||
recurrence MarketDay on Saturday {
|
||||
block market {
|
||||
06:00 -> 14:00
|
||||
action: SellAtMarket
|
||||
place: "town_square"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Assistant baker schedule (helps during busy times)
|
||||
schedule AssistantSchedule extends BakerSchedule {
|
||||
// Assistant comes in later
|
||||
override work {
|
||||
06:00 -> 14:00
|
||||
action: AssistWithBaking
|
||||
}
|
||||
|
||||
// Assistant does a quick prep before work
|
||||
override pre_dawn_prep {
|
||||
05:30 -> 06:00
|
||||
action: QuickPrep
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user