Compare commits

...

4 Commits

  1. 3
      src/actor.rs
  2. 12
      src/apr.rs
  3. 3
      src/main.rs

3
src/actor.rs

@ -1,9 +1,6 @@
use ggez::graphics; use ggez::graphics;
use ggez::Context; use ggez::Context;
#[path = "board.rs"]
mod board;
pub enum ActorPosn { pub enum ActorPosn {
BoardPosn { BoardPosn {
x: u8, x: u8,

12
src/apr.rs

@ -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.

3
src/main.rs

@ -4,7 +4,10 @@ use ggez::{ContextBuilder, GameResult};
use std::env; use std::env;
use std::path; use std::path;
mod actor;
mod apr; mod apr;
mod behaviour;
mod board;
fn main() -> GameResult<()> { fn main() -> GameResult<()> {
let mut cb = ContextBuilder::new("apruebo", "s1m7u and e-dt"); let mut cb = ContextBuilder::new("apruebo", "s1m7u and e-dt");

Loading…
Cancel
Save