41 lines
938 B
Plaintext
41 lines
938 B
Plaintext
|
|
//! Template definitions for the Baker family
|
||
|
|
//!
|
||
|
|
//! This example demonstrates v0.2.0 features:
|
||
|
|
//! - Resource linking (uses_behaviors, uses_schedule)
|
||
|
|
//! - Template inheritance
|
||
|
|
//! - Multi-level template hierarchies
|
||
|
|
|
||
|
|
// Base template for all persons
|
||
|
|
template Person {
|
||
|
|
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)
|
||
|
|
template Child {
|
||
|
|
include Person
|
||
|
|
uses behaviors: PlayBehavior, LearnBehavior
|
||
|
|
school_grade: 1..12
|
||
|
|
curiosity: 0.0..1.0
|
||
|
|
}
|