Files
RAGECOOP-V/Client/Scripts/Sync/Entities/Vehicle/SyncedVehicle.Variables.cs

85 lines
2.8 KiB
C#
Raw Normal View History

2022-10-23 19:02:39 +08:00
using System.Collections.Generic;
2022-08-18 20:44:39 +08:00
using GTA;
using GTA.Math;
2022-09-06 21:46:35 +08:00
using RageCoop.Core;
2022-08-18 20:44:39 +08:00
2022-09-06 21:46:35 +08:00
namespace RageCoop.Client
{
public partial class SyncedVehicle
{
2022-08-18 20:44:39 +08:00
public Vehicle MainVehicle { get; internal set; }
#region -- SYNC DATA --
2022-10-23 19:02:39 +08:00
2022-08-18 20:44:39 +08:00
internal Vector3 RotationVelocity { get; set; }
internal float SteeringAngle { get; set; }
internal float ThrottlePower { get; set; }
internal float BrakePower { get; set; }
internal float DeluxoWingRatio { get; set; } = -1;
internal byte LandingGear { get; set; }
internal VehicleRoofState RoofState { get; set; }
internal VehicleDamageModel DamageModel { get; set; }
internal byte[] Colors { get; set; }
internal Dictionary<int, int> Mods { get; set; }
internal float EngineHealth { get; set; }
internal VehicleLockStatus LockStatus { get; set; }
internal byte RadioStation = 255;
internal string LicensePlate { get; set; }
internal int Livery { get; set; } = -1;
internal VehicleDataFlags Flags { get; set; }
#endregion
#region FLAGS
2022-10-23 19:02:39 +08:00
internal bool EngineRunning => Flags.HasVehFlag(VehicleDataFlags.IsEngineRunning);
internal bool Transformed => Flags.HasVehFlag(VehicleDataFlags.IsTransformed);
internal bool HornActive => Flags.HasVehFlag(VehicleDataFlags.IsHornActive);
internal bool LightsOn => Flags.HasVehFlag(VehicleDataFlags.AreLightsOn);
internal bool BrakeLightsOn => Flags.HasVehFlag(VehicleDataFlags.AreBrakeLightsOn);
internal bool HighBeamsOn => Flags.HasVehFlag(VehicleDataFlags.AreHighBeamsOn);
internal bool SireneActive => Flags.HasVehFlag(VehicleDataFlags.IsSirenActive);
internal bool IsDead => Flags.HasVehFlag(VehicleDataFlags.IsDead);
internal bool IsDeluxoHovering => Flags.HasVehFlag(VehicleDataFlags.IsDeluxoHovering);
2022-08-18 20:44:39 +08:00
#endregion
#region FIXED-DATA
internal bool IsMotorcycle;
internal bool IsAircraft;
internal bool HasRocketBoost;
internal bool HasParachute;
internal bool HasRoof;
internal bool IsSubmarineCar;
internal bool IsDeluxo;
2022-11-20 15:55:11 +08:00
internal bool IsTrain;
private const float RotCalMult = 10f;
2022-11-30 20:17:06 +08:00
2022-08-18 20:44:39 +08:00
#endregion
#region PRIVATE
2022-10-23 19:02:39 +08:00
private byte[] _lastVehicleColors = { 0, 0 };
private Dictionary<int, int> _lastVehicleMods = new();
2022-10-23 19:02:39 +08:00
private bool _lastHornActive;
private bool _lastTransformed;
2022-08-18 20:44:39 +08:00
internal int _lastLivery = -1;
2022-08-18 22:08:06 +08:00
private Vector3 _predictedPosition;
internal Quaternion LastQuaternion;
2022-10-23 19:02:39 +08:00
2022-08-18 20:44:39 +08:00
#endregion
#region OUTGOING
2022-10-23 19:02:39 +08:00
2022-08-18 20:44:39 +08:00
internal float LastNozzleAngle { get; set; }
internal float LastEngineHealth { get; set; }
internal Vector3 LastVelocity { get; set; }
2022-10-23 19:02:39 +08:00
2022-08-18 20:44:39 +08:00
#endregion
}
}