1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
pub mod deletion_tool;
pub mod icon_tool;
pub mod room_tool;
pub mod wall_tool;
pub use deletion_tool::DeletionTool;
pub use icon_tool::IconTool;
pub use room_tool::RoomTool;
pub use wall_tool::WallTool;
use crate::button::Button;
use crate::map_data::MapData;
use crate::transform::Transform;
use raylib::core::drawing::RaylibDrawHandle;
use raylib::RaylibHandle;
#[derive(Copy, Clone, Debug, PartialEq)]
#[repr(u8)]
pub enum ToolType {
RoomTool,
WallTool,
IconTool,
DeletionTool,
NumTools,
}
pub trait Tool {
fn activate(&mut self) {}
fn deactivate(&mut self) {}
fn update(&mut self, _map: &MapData, _rl: &RaylibHandle, _transform: &Transform) {}
fn active_update(
&mut self,
map: &mut MapData,
rl: &RaylibHandle,
transform: &Transform,
mouse_blocked: bool,
);
fn draw(&self, _map: &MapData, _rld: &mut RaylibDrawHandle, _transform: &Transform) {}
fn activation_key(&self) -> Button;
}
|