Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub struct Character {
- // Creature become a member of Character
- creature: Creature,
- // Other field omitted.
- }
- impl Character {
- pub fn new() -> Character {
- let c = Creature::new();
- Character{ creature: c }
- }
- }
- impl Priority for Character {
- fn get_priority(&self) -> i32 {
- self.creature.get_priority()
- }
- fn set_priority(&mut self, value: i32) {
- self.creature.set_priority(value);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement