daily pastebin goal
78%
SHARE
TWEET

[Rust] Creature class

cwchen Sep 3rd, 2017 301 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pub struct Creature {
  2.     priority: i32,
  3.     // Other fields omitted.
  4. }
  5.  
  6. impl Creature {
  7.     pub fn new() -> Creature {
  8.         Creature{ priority: 0 }
  9.     }
  10. }
  11.  
  12. impl Priority for Creature {
  13.      fn get_priority(&self) -> i32 {
  14.          self.priority
  15.      }
  16.  
  17.      fn set_priority(&mut self, value: i32) {
  18.          self.priority = value;
  19.      }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top