use crate::map_data::MinimapPos;
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum ShipVisibility {
Visible,
MinimapOnly,
Undetected,
}
#[derive(Debug)]
pub enum DrawCommand {
ShotTracer {
from: MinimapPos,
to: MinimapPos,
color: [u8; 3],
},
Torpedo { pos: MinimapPos, color: [u8; 3] },
Smoke {
pos: MinimapPos,
radius: i32,
color: [u8; 3],
alpha: f32,
},
Ship {
pos: MinimapPos,
yaw: f32,
species: Option<String>,
color: Option<[u8; 3]>,
visibility: ShipVisibility,
opacity: f32,
is_self: bool,
player_name: Option<String>,
ship_name: Option<String>,
is_detected_teammate: bool,
},
HealthBar {
pos: MinimapPos,
fraction: f32,
fill_color: [u8; 3],
background_color: [u8; 3],
background_alpha: f32,
},
DeadShip {
pos: MinimapPos,
yaw: f32,
species: Option<String>,
color: Option<[u8; 3]>,
is_self: bool,
player_name: Option<String>,
ship_name: Option<String>,
},
CapturePoint {
pos: MinimapPos,
radius: i32,
color: [u8; 3],
alpha: f32,
label: String,
progress: f32,
invader_color: Option<[u8; 3]>,
},
TurretDirection {
pos: MinimapPos,
yaw: f32,
color: [u8; 3],
length: i32,
},
Building {
pos: MinimapPos,
color: [u8; 3],
is_alive: bool,
},
Plane {
pos: MinimapPos,
icon_key: String,
},
ConsumableRadius {
pos: MinimapPos,
radius_px: i32,
color: [u8; 3],
alpha: f32,
},
ConsumableIcons {
pos: MinimapPos,
icon_keys: Vec<String>,
is_friendly: bool,
has_hp_bar: bool,
},
ScoreBar {
team0: i32,
team1: i32,
team0_color: [u8; 3],
team1_color: [u8; 3],
},
Timer { seconds: f32 },
KillFeed { entries: Vec<(String, String)> },
}
pub trait RenderTarget {
fn begin_frame(&mut self);
fn draw(&mut self, cmd: &DrawCommand);
fn end_frame(&mut self);
}