Advertisement
cwchen

[Rust] Using Creature and Character classes

Sep 3rd, 2017
3,288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.41 KB | None | 0 0
  1. fn main() {
  2.     let mut goblin = Creature::new();
  3.     let mut fighter = Character::new();
  4.  
  5.     println!("The priority of the goblin is {}", goblin.get_priority());
  6.     println!("The priority of the fighter is {}", fighter.get_priority());
  7.  
  8.     println!("Set the priority of the fighter");
  9.     fighter.set_priority(2);
  10.     println!("The priority of the fighter is {} now",
  11.         fighter.get_priority());
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement