|
@ -3,12 +3,9 @@ use ggez::graphics::{self, Color, DrawMode, Mesh, MeshBuilder}; |
|
|
use ggez::input::mouse::{self, MouseButton}; |
|
|
use ggez::input::mouse::{self, MouseButton}; |
|
|
use ggez::{Context, GameResult}; |
|
|
use ggez::{Context, GameResult}; |
|
|
|
|
|
|
|
|
#[path = "actor.rs"] |
|
|
use crate::actor; |
|
|
mod actor; |
|
|
use crate::behaviour; |
|
|
#[path = "behaviour.rs"] |
|
|
use crate::board; |
|
|
mod behaviour; |
|
|
|
|
|
#[path = "board.rs"] |
|
|
|
|
|
mod board; |
|
|
|
|
|
|
|
|
|
|
|
pub struct Apr { |
|
|
pub struct Apr { |
|
|
board: board::Board, |
|
|
board: board::Board, |
|
@ -17,6 +14,8 @@ pub struct Apr { |
|
|
dragging: bool, |
|
|
dragging: bool, |
|
|
|
|
|
|
|
|
actors: Vec<actor::Actor>, |
|
|
actors: Vec<actor::Actor>, |
|
|
|
|
|
|
|
|
|
|
|
#[allow(dead_code)] |
|
|
behaviours: Vec<behaviour::Behaviour>, |
|
|
behaviours: Vec<behaviour::Behaviour>, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -70,6 +69,7 @@ impl Apr { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[allow(dead_code)] |
|
|
pub fn set_colour(&mut self, r: usize, c: usize, clr: u8) { |
|
|
pub fn set_colour(&mut self, r: usize, c: usize, clr: u8) { |
|
|
//You should only modify self.board through this method.
|
|
|
//You should only modify self.board through this method.
|
|
|
self.board.board[r][c] = clr; //Making a getter for self.board would sadly break borrowing in the same way that closest_square_coords does.
|
|
|
self.board.board[r][c] = clr; //Making a getter for self.board would sadly break borrowing in the same way that closest_square_coords does.
|
|
|