Class WarfareVehicle
- Namespace
- Uncreated.Warfare.Vehicles.WarfareVehicles
- Assembly
- Uncreated.Warfare.dll
[CannotApplyEqualityOperator]
public class WarfareVehicle : IDisposable, ITransformObject, IEquatable<WarfareVehicle>, IEquatable<InteractableVehicle>, IComparable<WarfareVehicle>, IComparable<InteractableVehicle>
- Inheritance
-
WarfareVehicle
- Implements
-
IEquatable<InteractableVehicle>IComparable<InteractableVehicle>
- Inherited Members
- Extension Methods
Constructors
WarfareVehicle(InteractableVehicle, WarfareVehicleInfo, IServiceProvider)
public WarfareVehicle(InteractableVehicle interactableVehicle, WarfareVehicleInfo info, IServiceProvider serviceProvider)
Parameters
interactableVehicleInteractableVehicleinfoWarfareVehicleInfoserviceProviderIServiceProvider
Properties
AdvancedDamageApplier
public AdvancedVehicleDamageApplier AdvancedDamageApplier { get; }
Property Value
Alive
If the vehicle is driveable or submerged.
public bool Alive { get; }
Property Value
Asset
public VehicleAsset Asset { get; }
Property Value
- VehicleAsset
Component
public WarfareVehicleComponent Component { get; }
Property Value
DamageTracker
public VehicleDamageTracker DamageTracker { get; }
Property Value
FlareEmitter
public FlareEmitter? FlareEmitter { get; }
Property Value
Info
public WarfareVehicleInfo Info { get; }
Property Value
InstanceId
public uint InstanceId { get; }
Property Value
NeedsAutoResupply
public bool NeedsAutoResupply { get; }
Property Value
OriginalOwner
The player who originally owned the vehicle. The owner can change when players use '/vehicle give' so this stores the first owner.
public CSteamID OriginalOwner { get; }
Property Value
- CSteamID
Remarks
This is also who is awarded credits from '/abandon'.
Position
The world position of the object.
public Vector3 Position { get; set; }
Property Value
- Vector3
Exceptions
- GameThreadException
Not on main thread.
- NotSupportedException
Not able to set position.
Rotation
The world rotation of the object.
public Quaternion Rotation { get; set; }
Property Value
- Quaternion
Exceptions
- GameThreadException
Not on main thread.
- NotSupportedException
Not able to set rotation.
Spawn
public VehicleSpawner? Spawn { get; }
Property Value
TranportTracker
public TranportTracker TranportTracker { get; }
Property Value
Vehicle
public InteractableVehicle Vehicle { get; }
Property Value
- InteractableVehicle
VehicleHUD
public VehicleHUD? VehicleHUD { get; }
Property Value
Methods
CompareTo(InteractableVehicle)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(InteractableVehicle other)
Parameters
otherInteractableVehicleAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
ValueMeaning
Less than zero
This instance precedes
otherin the sort order.Zero
This instance occurs in the same position in the sort order as
other.Greater than zero
This instance follows
otherin the sort order.
CompareTo(WarfareVehicle)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(WarfareVehicle other)
Parameters
otherWarfareVehicleAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
ValueMeaning
Less than zero
This instance precedes
otherin the sort order.Zero
This instance occurs in the same position in the sort order as
other.Greater than zero
This instance follows
otherin the sort order.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Equals(InteractableVehicle)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(InteractableVehicle other)
Parameters
otherInteractableVehicleAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
Equals(WarfareVehicle)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(WarfareVehicle other)
Parameters
otherWarfareVehicleAn object to compare with this object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
SetPosition(Vector3)
public void SetPosition(Vector3 position)
Parameters
positionVector3
SetPositionAndRotation(Vector3, Quaternion)
Set the position and rotation at the same time.
public void SetPositionAndRotation(Vector3 position, Quaternion rotation)
Parameters
positionVector3rotationQuaternion
Exceptions
- GameThreadException
Not on main thread.
- NotSupportedException
Not able to set position or rotation.
SetRotation(Quaternion)
public void SetRotation(Quaternion rotation)
Parameters
rotationQuaternion