Beispiel #1
0
        public AircraftData(int entityId, int typeId, CampType camp)
            : base(entityId, typeId, camp)
        {
            IDataTable <DRAircraft> dtAircraft = GameEntry.DataTable.GetDataTable <DRAircraft>();
            DRAircraft drAircraft = dtAircraft.GetDataRow(TypeId);

            if (drAircraft == null)
            {
                return;
            }

            m_ThrusterData = new ThrusterData(GameEntry.Entity.GenerateSerialId(), drAircraft.ThrusterId, Id, Camp);

            for (int index = 0, weaponId = 0; (weaponId = drAircraft.GetWeaponIds(index)) > 0; index++)
            {
                AttachWeaponData(new WeaponData(GameEntry.Entity.GenerateSerialId(), weaponId, Id, Camp));
            }

            for (int index = 0, armorId = 0; (armorId = drAircraft.GetArmorIds(index)) > 0; index++)
            {
                AttachArmorData(new ArmorData(GameEntry.Entity.GenerateSerialId(), armorId, Id, Camp));
            }

            m_DeadEffectId = drAircraft.DeadEffectId;
            m_DeadSoundId  = drAircraft.DeadSoundId;

            HP = m_MaxHP;
        }
        protected internal override void OnShow(object userData)
        {
            base.OnShow(userData);

            m_ThrusterData = userData as ThrusterData;
            if (m_ThrusterData == null)
            {
                Log.Error("Thruster data is invalid.");
                return;
            }

            GameEntry.Entity.AttachEntity(this, m_ThrusterData.OwnerId, AttachPoint);
        }
 public static void ShowThruster(this EntityComponent entityComponent, ThrusterData data)
 {
     entityComponent.ShowEntity(typeof(Thruster), "Thruster", data);
 }