add fn add_agent(), temporary mutable access privileges in Word
This commit is contained in:
1 parent
63f2ba31d0
commit
f9842f635b
2 files changed
+49
-4
No files matched your search
+4
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Agent{
|
||||
pos: (i32, i32),
|
||||
ang: i8,
|
||||
@@ -35,4 +35,7 @@ impl Agent {
|
||||
pub fn rotate(&mut self, a: i8){
|
||||
self.ang = ((self.ang + a) % 4 + 4) % 4;
|
||||
}
|
||||
pub fn get_pos(&self) -> (i32, i32) {
|
||||
self.pos.clone()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user