public int RestoreTickDeltaTime = 3000; //TODO store it from shipdata public Ship(ShipData shipData) { p = new ShipData(shipData, this); if (p.Rotation == new Quaternion(0f, 0f, 0f, 0f)) { p.Rotation = new Quaternion(0f, 0f, 0f, 1f); } //rotationToTarget = p.SO.rotation; moveCommand = MoveType.stop; //SendEvent(ShipEvenentsType.move); //host = _host; //newtargetToMove = null; Weapons = new Weapon[shipData.Weapons.Length]; for (int i = 0; i < shipData.Weapons.Length; i++) { Weapons[i] = new Weapon(shipData.Weapons[i], this); } Equipments = new Equipment[shipData.Equipments.Length]; for (int i = 0; i < shipData.Equipments.Length; i++) { Equipments[i] = new Equipment(shipData.Equipments[i], this); } RestoreTick(); }
public ShipData(ShipData value, Ship ship) : base(value) { ShipLink = ship; SpeedMax = value.SpeedMax; RotationSpeed = value.RotationSpeed; AccelerationMax = value.AccelerationMax; SpeedNew = value.SpeedNew; Hull_full = value.Hull_full; Armor_full = value.Armor_full; Shield_full = value.Shield_full; Capasitor_full = value.Capasitor_full; Hull = value.Hull; Armor = value.Armor; Shield = value.Shield; Capasitor = value.Capasitor; Hull_restore = value.Hull_restore; Armor_restore = value.Armor_restore; Shield_restore = value.Shield_restore; Capasitor_restore = value.Capasitor_restore; AgrDistance = value.AgrDistance; VisionDistance = value.VisionDistance; Destroyed = value.Destroyed; Hidden = value.Hidden; Mob = value.Mob; WarpDriveStartTime = value.WarpDriveStartTime; WarpSpeed = value.WarpSpeed; Weapons = new WeaponData[value.Weapons.Length]; for (int i = 0; i < value.Weapons.Length; i++) { Weapons[i] = new WeaponData(value.Weapons[i]); } Equipments = new EquipmentData[value.Equipments.Length]; for (int i = 0; i < value.Equipments.Length; i++) { Equipments[i] = new EquipmentData(value.Equipments[i]); } }
public void Update(ShipData value) { Id = value.Id; VisibleName = value.VisibleName; Type = value.Type; Position = value.Position; Rotation = value.Rotation; Speed = value.Speed; Prefab = value.Prefab; SpeedMax = value.SpeedMax; RotationSpeed = value.RotationSpeed; AccelerationMax = value.AccelerationMax; SpeedNew = value.SpeedNew; Hull_full = value.Hull_full; Armor_full = value.Armor_full; Shield_full = value.Shield_full; Capasitor_full = value.Capasitor_full; Hull = value.Hull; Armor = value.Armor; Shield = value.Shield; Capasitor = value.Capasitor; Hull_restore = value.Hull_restore; Armor_restore = value.Armor_restore; Shield_restore = value.Shield_restore; Capasitor_restore = value.Capasitor_restore; AgrDistance = value.AgrDistance; VisionDistance = value.VisionDistance; Destroyed = value.Destroyed; Hidden = value.Hidden; Mob = value.Mob; WarpDriveStartTime = value.WarpDriveStartTime; WarpSpeed = value.WarpSpeed; }