pub trait Controllable: Send + Sync {
Show 100 methods
fn id(&self) -> u8;
fn revision(&self) -> i64;
fn class(&self) -> &str;
fn name(&self) -> &str;
fn level(&self) -> u8;
fn radius(&self) -> f32;
fn gravity(&self) -> f32;
fn efficiency_tactical(&self) -> f32;
fn efficiency_economical(&self) -> f32;
fn visible_range_multiplier(&self) -> f32;
fn energy_max(&self) -> f32;
fn particles_max(&self) -> f32;
fn ions_max(&self) -> f32;
fn energy_cells(&self) -> f32;
fn particles_cells(&self) -> f32;
fn ions_cells(&self) -> f32;
fn energy_reactor(&self) -> f32;
fn particles_reactor(&self) -> f32;
fn ions_reactor(&self) -> f32;
fn hull_max(&self) -> f32;
fn hull_armor(&self) -> f32;
fn hull_repair(&self) -> &EnergyCost;
fn shield_max(&self) -> f32;
fn shield_armor(&self) -> f32;
fn shield_load(&self) -> &EnergyCost;
fn engine_speed(&self) -> f32;
fn engine_acceleration(&self) -> &EnergyCost;
fn scanner_degree_per_scan(&self) -> f32;
fn scanner_count(&self) -> u8;
fn scanner_area(&self) -> &ScanEnergyCost;
fn weapon_shot(&self) -> &WeaponEnergyCost;
fn weapon_hull(&self) -> f32;
fn weapon_hull_armor(&self) -> f32;
fn weapon_shield(&self) -> f32;
fn weapon_shield_armor(&self) -> f32;
fn weapon_visible_range_multiplier(&self) -> f32;
fn weapon_gravity(&self) -> f32;
fn weapon_size(&self) -> f32;
fn weapon_production(&self) -> f32;
fn weapon_production_load(&self) -> f32;
fn weapon_sub_directions(&self) -> u8;
fn weapon_sub_directions_length(&self) -> f32;
fn builder_time(&self) -> f32;
fn builder_time_factory_energy(&self) -> f32;
fn builder_time_factory_particles(&self) -> f32;
fn builder_time_factory_ions(&self) -> f32;
fn builder_capabilities(&self) -> &Vec<UnitKind>;
fn energy_transfer_energy(&self) -> &EnergyCost;
fn energy_transfer_particles(&self) -> &EnergyCost;
fn energy_transfer_ions(&self) -> &EnergyCost;
fn cargo_slots(&self) -> u8;
fn cargo_amount(&self) -> f32;
fn crystal_converter(&self) -> &EnergyCost;
fn crystal_slots(&self) -> u8;
fn tractor_beam(&self) -> &EnergyCost;
fn tractor_beam_range(&self) -> f32;
fn scores(&self) -> &Arc<Scores>;
fn energy(&self) -> f32;
fn particles(&self) -> f32;
fn ions(&self) -> f32;
fn hull(&self) -> f32;
fn shield(&self) -> f32;
fn build_position(&self) -> Option<Vector>;
fn build_progress(&self) -> f32;
fn is_building(&self) -> Option<AnyControllable>;
fn is_built_by(&self) -> Option<AnyControllable>;
fn weapon_production_status(&self) -> f32;
fn crystals(&self) -> RwLockReadGuard<'_, Vec<Arc<CrystalCargoItem>>>;
fn cargo_items(&self) -> RwLockReadGuard<'_, Vec<AnyCargoItem>>;
fn universe(&self) -> Weak<Universe>;
fn haste_time(&self) -> u16;
fn double_damage_time(&self) -> u16;
fn quad_damage_time(&self) -> u16;
fn cloak_time(&self) -> u16;
fn connector(&self) -> &Weak<Connector>;
fn is_active(&self) -> bool;
fn is_pending_shutdown(&self) -> bool;
fn scan_list(&self) -> &RwLock<Vec<AnyUnit>>;
fn update(&self, packet: &Packet) -> Result<(), Error>;
fn update_extended(&self, packet: &Packet) -> Result<(), Error>;
fn set_crystals(
&self,
crystals: Vec<Arc<CrystalCargoItem>>
) -> Result<(), Error>;
fn set_cargo_items(&self, items: Vec<AnyCargoItem>) -> Result<(), Error>;
fn set_scan_list(&self, list: Vec<AnyUnit>) -> Result<(), Error>;
fn set_active(&self, active: bool) -> Result<(), Error>;
fn close(&self) -> Result<(), Error> { ... }
fn scan_area(&self, degree: f32, range: f32) -> Result<Vec<AnyUnit>, Error> { ... }
fn scan_areas(&self, info: &[ScanInfo]) -> Result<Vec<AnyUnit>, Error> { ... }
fn accelerate(&self, movement: &Vector) -> Result<(), Error> { ... }
fn build(
&self,
class: &str,
name: &str,
direction: f32,
crystals: &[Box<CrystalCargoItem>]
) -> Result<AnyControllable, Error> { ... }
fn kill(&self) -> Result<(), Error> { ... }
fn repair_hull(&self, hull: f32) -> Result<(), Error> { ... }
fn load_shields(&self, amount: f32) -> Result<(), Error> { ... }
fn harvest_nebula(&self, amount: f32) -> Result<(), Error> { ... }
fn flush_cargo(&self) -> Result<(), Error> { ... }
fn produce_crystal(&self, name: &str) -> Result<Arc<CrystalCargoItem>, Error> { ... }
fn shoot_full_load(
&self,
direction: &Vector,
time: u16
) -> Result<String, Error> { ... }
fn shoot_with_load(
&self,
direction: &Vector,
time: u16,
load: f32,
damage: f32
) -> Result<String, Error> { ... }
fn shoot(
&self,
direction: &Vector,
launch_angle: f32,
time: u16,
load: f32,
damage_hull: f32,
damage_shields: f32,
damage_energy: f32,
sub_directions: &[SubDirection]
) -> Result<String, Error> { ... }
fn transfer_energy(
&self,
destination: &str,
energy: f32,
particles: f32,
ions: f32
) -> Result<(), Error> { ... }
fn tractorbeam(
&self,
direction: f32,
range: f32,
force: f32
) -> Result<bool, Error> { ... }
}
Required Methods
fn id(&self) -> u8
fn revision(&self) -> i64
fn class(&self) -> &str
fn name(&self) -> &str
fn radius(&self) -> f32
fn gravity(&self) -> f32
fn efficiency_tactical(&self) -> f32
fn efficiency_economical(&self) -> f32
fn visible_range_multiplier(&self) -> f32
fn energy_max(&self) -> f32
fn particles_max(&self) -> f32
fn ions_max(&self) -> f32
fn energy_cells(&self) -> f32
fn particles_cells(&self) -> f32
fn ions_cells(&self) -> f32
fn energy_reactor(&self) -> f32
fn particles_reactor(&self) -> f32
fn ions_reactor(&self) -> f32
fn hull_max(&self) -> f32
fn hull_armor(&self) -> f32
fn hull_repair(&self) -> &EnergyCost
fn shield_max(&self) -> f32
fn shield_armor(&self) -> f32
fn shield_load(&self) -> &EnergyCost
fn engine_speed(&self) -> f32
fn engine_acceleration(&self) -> &EnergyCost
fn scanner_degree_per_scan(&self) -> f32
fn scanner_count(&self) -> u8
fn scanner_area(&self) -> &ScanEnergyCost
fn weapon_shot(&self) -> &WeaponEnergyCost
fn weapon_hull(&self) -> f32
fn weapon_hull_armor(&self) -> f32
fn weapon_shield(&self) -> f32
fn weapon_shield_armor(&self) -> f32
fn weapon_visible_range_multiplier(&self) -> f32
fn weapon_gravity(&self) -> f32
fn weapon_size(&self) -> f32
fn weapon_production(&self) -> f32
fn weapon_production_load(&self) -> f32
fn weapon_sub_directions(&self) -> u8
fn weapon_sub_directions_length(&self) -> f32
fn builder_time(&self) -> f32
fn builder_time_factory_energy(&self) -> f32
fn builder_time_factory_particles(&self) -> f32
fn builder_time_factory_ions(&self) -> f32
fn builder_capabilities(&self) -> &Vec<UnitKind>
fn energy_transfer_energy(&self) -> &EnergyCost
fn energy_transfer_particles(&self) -> &EnergyCost
fn energy_transfer_ions(&self) -> &EnergyCost
fn cargo_slots(&self) -> u8
fn cargo_amount(&self) -> f32
fn crystal_converter(&self) -> &EnergyCost
fn crystal_slots(&self) -> u8
fn tractor_beam(&self) -> &EnergyCost
fn tractor_beam_range(&self) -> f32
fn scores(&self) -> &Arc<Scores>
fn energy(&self) -> f32
fn particles(&self) -> f32
fn ions(&self) -> f32
fn hull(&self) -> f32
fn shield(&self) -> f32
fn build_position(&self) -> Option<Vector>
fn build_progress(&self) -> f32
fn is_building(&self) -> Option<AnyControllable>
fn is_built_by(&self) -> Option<AnyControllable>
fn weapon_production_status(&self) -> f32
fn crystals(&self) -> RwLockReadGuard<'_, Vec<Arc<CrystalCargoItem>>>
fn cargo_items(&self) -> RwLockReadGuard<'_, Vec<AnyCargoItem>>
fn universe(&self) -> Weak<Universe>
fn haste_time(&self) -> u16
fn double_damage_time(&self) -> u16
fn quad_damage_time(&self) -> u16
fn cloak_time(&self) -> u16
fn connector(&self) -> &Weak<Connector>
fn is_active(&self) -> bool
fn is_pending_shutdown(&self) -> bool
fn scan_list(&self) -> &RwLock<Vec<AnyUnit>>
fn update(&self, packet: &Packet) -> Result<(), Error>
fn update_extended(&self, packet: &Packet) -> Result<(), Error>
fn set_crystals(&self, crystals: Vec<Arc<CrystalCargoItem>>) -> Result<(), Error>
fn set_cargo_items(&self, items: Vec<AnyCargoItem>) -> Result<(), Error>
fn set_scan_list(&self, list: Vec<AnyUnit>) -> Result<(), Error>
fn set_active(&self, active: bool) -> Result<(), Error>
Provided Methods
fn close(&self) -> Result<(), Error>
fn scan_area(&self, degree: f32, range: f32) -> Result<Vec<AnyUnit>, Error>
fn scan_areas(&self, info: &[ScanInfo]) -> Result<Vec<AnyUnit>, Error>
fn accelerate(&self, movement: &Vector) -> Result<(), Error>
fn build(
&self,
class: &str,
name: &str,
direction: f32,
crystals: &[Box<CrystalCargoItem>]
) -> Result<AnyControllable, Error>
fn kill(&self) -> Result<(), Error>
fn repair_hull(&self, hull: f32) -> Result<(), Error>
fn load_shields(&self, amount: f32) -> Result<(), Error>
fn harvest_nebula(&self, amount: f32) -> Result<(), Error>
fn flush_cargo(&self) -> Result<(), Error>
fn produce_crystal(&self, name: &str) -> Result<Arc<CrystalCargoItem>, Error>
fn shoot_full_load(&self, direction: &Vector, time: u16) -> Result<String, Error>
fn shoot_with_load(
&self,
direction: &Vector,
time: u16,
load: f32,
damage: f32
) -> Result<String, Error>
fn shoot(
&self,
direction: &Vector,
launch_angle: f32,
time: u16,
load: f32,
damage_hull: f32,
damage_shields: f32,
damage_energy: f32,
sub_directions: &[SubDirection]
) -> Result<String, Error>
sourcefn transfer_energy(
&self,
destination: &str,
energy: f32,
particles: f32,
ions: f32
) -> Result<(), Error>
fn transfer_energy(
&self,
destination: &str,
energy: f32,
particles: f32,
ions: f32
) -> Result<(), Error>
Transfer energy to another ship in range of 200
sourcefn tractorbeam(
&self,
direction: f32,
range: f32,
force: f32
) -> Result<bool, Error>
fn tractorbeam(
&self,
direction: f32,
range: f32,
force: f32
) -> Result<bool, Error>
Engages the tractorbeam of the ship into the given direction, range and with the specified force. The tractorbeam changes the movement-Vector of objects towards or away from you. When you affect a [Mobility#Still] or [Mobility#Steady] [Unit] your movement gets affected in the opposite way.