2026-02-13 21:52:03 +00:00
|
|
|
//! Template definitions for the Baker family
|
|
|
|
|
//!
|
2026-02-14 14:45:17 +00:00
|
|
|
//! This example demonstrates v0.3.0 features:
|
|
|
|
|
//! - Species-based template inheritance (template Name: Species)
|
2026-02-13 21:52:03 +00:00
|
|
|
//! - Resource linking (uses_behaviors, uses_schedule)
|
2026-02-14 14:45:17 +00:00
|
|
|
//! - Template inheritance with include
|
2026-02-13 21:52:03 +00:00
|
|
|
//! - Multi-level template hierarchies
|
|
|
|
|
|
2026-02-14 14:45:17 +00:00
|
|
|
// Base template for all persons, inheriting from Human species
|
|
|
|
|
template Person: Human {
|
2026-02-13 21:52:03 +00:00
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-14 14:45:17 +00:00
|
|
|
// Child template (no work schedule), also inherits from Human species
|
|
|
|
|
template Child: Human {
|
2026-02-13 21:52:03 +00:00
|
|
|
include Person
|
|
|
|
|
uses behaviors: PlayBehavior, LearnBehavior
|
|
|
|
|
school_grade: 1..12
|
|
|
|
|
curiosity: 0.0..1.0
|
|
|
|
|
}
|