Table of Contents

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

interactableVehicle InteractableVehicle
info WarfareVehicleInfo
serviceProvider IServiceProvider

Properties

AdvancedDamageApplier

public AdvancedVehicleDamageApplier AdvancedDamageApplier { get; }

Property Value

AdvancedVehicleDamageApplier

Alive

If the vehicle is driveable or submerged.

public bool Alive { get; }

Property Value

bool

Asset

public VehicleAsset Asset { get; }

Property Value

VehicleAsset

Component

public WarfareVehicleComponent Component { get; }

Property Value

WarfareVehicleComponent

DamageTracker

public VehicleDamageTracker DamageTracker { get; }

Property Value

VehicleDamageTracker

FlareEmitter

public FlareEmitter? FlareEmitter { get; }

Property Value

FlareEmitter

Info

public WarfareVehicleInfo Info { get; }

Property Value

WarfareVehicleInfo

InstanceId

public uint InstanceId { get; }

Property Value

uint

NeedsAutoResupply

public bool NeedsAutoResupply { get; }

Property Value

bool

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

VehicleSpawner

TranportTracker

public TranportTracker TranportTracker { get; }

Property Value

TranportTracker

Vehicle

public InteractableVehicle Vehicle { get; }

Property Value

InteractableVehicle

VehicleHUD

public VehicleHUD? VehicleHUD { get; }

Property Value

VehicleHUD

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

other InteractableVehicle

An 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:
Value

Meaning

Less than zero

This instance precedes other in the sort order.

Zero

This instance occurs in the same position in the sort order as other.

Greater than zero

This instance follows other in 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

other WarfareVehicle

An 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:
Value

Meaning

Less than zero

This instance precedes other in the sort order.

Zero

This instance occurs in the same position in the sort order as other.

Greater than zero

This instance follows other in 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

other InteractableVehicle

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(WarfareVehicle)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(WarfareVehicle other)

Parameters

other WarfareVehicle

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

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

position Vector3

SetPositionAndRotation(Vector3, Quaternion)

Set the position and rotation at the same time.

public void SetPositionAndRotation(Vector3 position, Quaternion rotation)

Parameters

position Vector3
rotation Quaternion

Exceptions

GameThreadException

Not on main thread.

NotSupportedException

Not able to set position or rotation.

SetRotation(Quaternion)

public void SetRotation(Quaternion rotation)

Parameters

rotation Quaternion