Skip to main content

Tool

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,
    ) { ... }
}

Required Methods§

Source

fn new() -> Self
where Self: Sized,

Source

fn id(&self) -> TheId

Source

fn info(&self) -> String

Source

fn icon_name(&self) -> String

Provided Methods§

Source

fn accel(&self) -> Option<char>

Source

fn help_url(&self) -> Option<String>

Source

fn tool_event( &mut self, tool_event: ToolEvent, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, ) -> bool

Source

fn map_event( &mut self, map_event: MapEvent, ui: &mut TheUI, ctx: &mut TheContext, map: &mut Map, server_ctx: &mut ServerContext, ) -> Option<ProjectUndoAtom>

Source

fn handle_event( &mut self, event: &TheEvent, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, ) -> bool

Source

fn draw_hud( &mut self, buffer: &mut TheRGBABuffer, map: &mut Map, ctx: &mut TheContext, server_ctx: &mut ServerContext, assets: &Assets, )

Implementors§