You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: data.rs
    path of file: ./repos/mk48/common/src/entity
    
    the code of the file until where you have to start completion: use crate::altitude::Altitude;
use crate::entity::{Armament, EntityKind, EntitySubKind, Exhaust, Sensors, Turret};
use crate::ticks;
use crate::ticks::Ticks;
use crate::transform::Transform;
use crate::velocity::Velocity;
use common_util::angle::Angle;
use common_util::range::map_ranges_fast;
use glam::Vec2;
use std::ops::Range;

#[allow(dead_code)]
#[derive(Clone, Debug)]
pub struct EntityData {
    pub kind: EntityKind,
    pub sub_kind: EntitySubKind,
    pub level: u8,
    pub limited: bool,
    pub npc: bool,
    
    
    pub fn armament_transform(&self, turret_angles: &[Angle], index: usize) -> Transform {
        let armament = &self.armaments[index];
        let mut transform = Transform {
            position: armament.position(),
            direction: armament.angle,
            velocity: Velocity::ZERO,
        };

        let weapon_data = armament.entity_type.data();

        // Shells start with all their velocity.
        if weapon_data.sub_kind == EntitySubKind::Shell {
            transform.velocity = weapon_data.speed
        } else if weapon_data.sub_kind == EntitySubKind::Plane {
            // Planes must attain minimum airspeed.
            transform.velocity = weapon_data.speed * 0.5;
        } else if armament.turret.is_some() && weapon_data.sub_kind == EntitySubKind::Torpedo {
            // Compressed gas.
            transform.velocity = Velocity::from_mps(10.0);
        } else if !armament.vertical {
            // Minimal launch velocity (except if vertical, in which case only initial velocity is up).
            transform.velocity = Velocity::from_mps(1.0);
        }

        if let Some(turret_index) = armament.turret {
            let turret = &self.turrets[turret_index];
            transform = Transform {
                position: turret.position(),
                direction: turret_angles[turret_index],
                velocity: Velocity::ZERO,
            } + transform;
        }
        transform
    }