VehicleLogger Class

From KitHack Model Club Wiki
Jump to navigation Jump to search

Back to SDK API Reference

VehicleLogger Class

This class handles logging for vehicles, tracking various metrics and events such as airspeed, altitude, damage, and log entries.

Public Constant Fields

Public Fields

  • `public Action<VehicleLogEntry> OnLogEntryAdded` - Action triggered when a log entry is added.
  • `public static VehicleLogger.LogLookbackDelegate OnLoggedOutcomeTrigger` - Delegate for handling logged outcome triggers.

Public Delegates

  • `public delegate void LogLookbackDelegate(VehicleLogger vlog, VehicleLogEntry trigger, IVehicleOwner owner)` - Delegate for handling log lookback events.

Public Events

Public Enums

Public Interfaces

  • `IVehicleComponent` - Interface for vehicle components.

Public Properties

  • `public Vehicle Vehicle { get; }` - Gets the vehicle associated with this logger.
  • `public bool Ready { get; }` - Gets a value indicating whether the logger is ready.
  • `public float MaxAirspeed { get; }` - Gets the maximum airspeed recorded.
  • `public float MaxAltitude { get; }` - Gets the maximum altitude recorded.
  • `public float MaxAcceleration { get; }` - Gets the maximum acceleration recorded.
  • `public double TotalDistanceTravelled { get; }` - Gets the total distance travelled.
  • `public float TotalAirTime { get; }` - Gets the total air time recorded.
  • `public float LastAirTime { get; }` - Gets the last air time recorded.
  • `public float LastGoodAirTime { get; }` - Gets the last good air time recorded.
  • `public double Lifetime { get; }` - Gets the lifetime of the vehicle logger.
  • `public double Runtime { get; }` - Gets the runtime of the vehicle logger.
  • `public int ShotsFired { get; set; }` - Gets or sets the number of shots fired.
  • `public int ShotsHit { get; set; }` - Gets or sets the number of shots hit.
  • `public float ShotAccuracy { get; }` - Gets the accuracy of shots fired.
  • `public int RecoverCount { get; }` - Gets the count of recoveries.

Public Methods

  • `public void AddLogEntry(VehicleLogEntry logEntry)` - Adds a log entry to the logger.
  • `void IVehicleComponent.OnVehicleSpawn(Vehicle v)` - Called when the vehicle spawns.
  • `private void onVehicleReset()` - Handles vehicle reset events.
  • `private void onVehicleWillDespawn(Vehicle arg0)` - Handles vehicle despawn events.
  • `public void OnDestroy()` - Called when the logger is destroyed.
  • `public void ResetStats(bool resetLifetimeValues)` - Resets the statistics of the logger.
  • `public void FixedUpdate()` - Called every fixed frame-rate frame.
  • `public bool HasDamageLogged(bool sinceLastReset = true)` - Checks if any damage has been logged since the last reset.
  • `public bool HasDamage()` - Checks if there is any damage.
  • `public int CountDamage()` - Counts the number of damaged parts.
  • `public float GetDamageFactor()` - Gets the damage factor of the vehicle.
  • `public bool HasEntry<T>() where T : VehicleLogEntry` - Checks if there is an entry of a specific type.
  • `public bool HasEntryWhere<T>(Func<T, bool> predicate) where T : VehicleLogEntry` - Checks if there is an entry that matches a specific predicate.
  • `public bool HasEntryWhere<T>(int skip, Func<T, bool> predicate) where T : VehicleLogEntry` - Checks if there is an entry that matches a specific predicate, skipping a number of entries.
  • `public int FindLatestEntryIndex<T>() where T : VehicleLogEntry` - Finds the index of the latest entry of a specific type.
  • `public int FindLatestEntryIndexWhere<T>(Func<T, bool> predicate) where T : VehicleLogEntry` - Finds the index of the latest entry that matches a specific predicate.
  • `public int FindEarliestEntryIndex<T>() where T : VehicleLogEntry` - Finds the index of the earliest entry of a specific type.
  • `public int FindEarliestEntryIndexWhere<T>(Func<T, bool> predicate) where T : VehicleLogEntry` - Finds the index of the earliest entry that matches a specific predicate.
  • `public IEnumerator<VehicleLogEntry> GetEnumerator()` - Gets the enumerator for the log entries.
  • `IEnumerator IEnumerable.GetEnumerator()` - Gets the enumerator for the log entries.
  • `public int Count { get; }` - Gets the count of log entries.
  • `public VehicleLogEntry this[int index] { get; }` - Gets the log entry at a specific index.

Public Structs

Public Classes

See Also

  • VehicleLogEntry Class
  • Spawn Class
  • Reset Class
  • Despawn Class
  • Repaired Class
  • Breakoff Class
  • IVehicleOwner Interface
  • GameEvents.Vehicles Class
  • Vehicle Class
  • Vector3d Struct
  • FloatingOrigin Class
  • UnityAction Delegate