Trait Tool
Source pub trait Tool: Send + Sync {
// Required methods
fn new() -> Self
where Self: Sized;
fn id(&self) -> TheId;
fn info(&self) -> String;
fn icon_name(&self) -> String;
// Provided methods
fn accel(&self) -> Option<char> { ... }
fn help_url(&self) -> Option<String> { ... }
fn tool_event(
&mut self,
tool_event: ToolEvent,
ui: &mut TheUI,
ctx: &mut TheContext,
project: &mut Project,
server_ctx: &mut ServerContext,
) -> bool { ... }
fn map_event(
&mut self,
map_event: MapEvent,
ui: &mut TheUI,
ctx: &mut TheContext,
map: &mut Map,
server_ctx: &mut ServerContext,
) -> Option<ProjectUndoAtom> { ... }
fn handle_event(
&mut self,
event: &TheEvent,
ui: &mut TheUI,
ctx: &mut TheContext,
project: &mut Project,
server_ctx: &mut ServerContext,
) -> bool { ... }
fn draw_hud(
&mut self,
buffer: &mut TheRGBABuffer,
map: &mut Map,
ctx: &mut TheContext,
server_ctx: &mut ServerContext,
assets: &Assets,
) { ... }
}