Table of Contents

Class ResourceFob

Namespace
Uncreated.Warfare.Fobs
Assembly
Uncreated.Warfare.dll

Base class for standard FOBs, caches, and any other FOBs that support items.

public class ResourceFob : IBuildableFob, ITransformObject, IResourceFob, IFob, IDeployable, ITranslationArgument, IDisposable
Inheritance
ResourceFob
Implements
Derived
Inherited Members
Extension Methods

Constructors

ResourceFob(IServiceProvider, string, IBuildable)

public ResourceFob(IServiceProvider serviceProvider, string name, IBuildable buildable)

Parameters

serviceProvider IServiceProvider
name string
buildable IBuildable

Fields

FobManager

protected readonly FobManager FobManager

Field Value

FobManager

Properties

AmmoCount

public float AmmoCount { get; }

Property Value

float

BuildCount

public float BuildCount { get; }

Property Value

float

Buildable

public IBuildable Buildable { get; protected set; }

Property Value

IBuildable

EffectiveRadius

public virtual float EffectiveRadius { get; }

Property Value

float

FriendlyProximity

public ISphereProximity FriendlyProximity { get; }

Property Value

ISphereProximity

Icon

public WorldIconInfo? Icon { get; }

Property Value

WorldIconInfo

IsProxied

public bool IsProxied { get; }

Property Value

bool

Name

The display name of the FOB on the FOB list.

public string Name { get; }

Property Value

string

NearbyEnemies

public ProximityCollector<WarfarePlayer> NearbyEnemies { get; }

Property Value

ProximityCollector<WarfarePlayer>

NearbyFriendlies

public ProximityCollector<WarfarePlayer> NearbyFriendlies { get; }

Property Value

ProximityCollector<WarfarePlayer>

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.

SpawnPosition

The position the player will spawn.

public Vector3 SpawnPosition { get; }

Property Value

Vector3

Team

The team that owns the FOB.

public Team Team { get; }

Property Value

Team

Yaw

The angle the player will spawn along the Y-axis.

public float Yaw { get; }

Property Value

float

Methods

ChangeSupplies(SupplyType, float)

public void ChangeSupplies(SupplyType supplyType, float amount)

Parameters

supplyType SupplyType
amount float

CheckDeployableFrom(WarfarePlayer, ChatService, DeploymentTranslations, in DeploySettings, IDeployable)

Initial check to see if a player can deploy from the location.

public virtual bool CheckDeployableFrom(WarfarePlayer player, ChatService chatService, DeploymentTranslations translations, in DeploySettings settings, IDeployable deployingTo)

Parameters

player WarfarePlayer
chatService ChatService
translations DeploymentTranslations
settings DeploySettings
deployingTo IDeployable

Returns

bool

CheckDeployableTo(WarfarePlayer, ChatService, DeploymentTranslations, in DeploySettings)

Initial check to see if a player can deploy to the location.

public virtual bool CheckDeployableTo(WarfarePlayer player, ChatService chatService, DeploymentTranslations translations, in DeploySettings settings)

Parameters

player WarfarePlayer
chatService ChatService
translations DeploymentTranslations
settings DeploySettings

Returns

bool

CheckDeployableToTick(WarfarePlayer, ChatService, DeploymentTranslations, in DeploySettings)

Periodic checks over time to see if a player can deploy to the location. This also runs just before the teleport.

public virtual bool CheckDeployableToTick(WarfarePlayer player, ChatService chatService, DeploymentTranslations translations, in DeploySettings settings)

Parameters

player WarfarePlayer
chatService ChatService
translations DeploymentTranslations
settings DeploySettings

Returns

bool

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool isDisposing)

Parameters

isDisposing bool

EnumerateEntities()

public IEnumerable<IFobEntity> EnumerateEntities()

Returns

IEnumerable<IFobEntity>

GetColor(Team)

Gets the display color of this FOB on the FOB list.

public virtual Color32 GetColor(Team viewingTeam)

Parameters

viewingTeam Team

Returns

Color32

GetDelay(WarfarePlayer)

Get the deployment delay in seconds.

public virtual TimeSpan GetDelay(WarfarePlayer player)

Parameters

player WarfarePlayer

Returns

TimeSpan

IsVisibleToPlayer(WarfarePlayer)

Whether the specified player should be able to see this fob on their FOB HUD.

public virtual bool IsVisibleToPlayer(WarfarePlayer player)

Parameters

player WarfarePlayer

Returns

bool

IsWithinRadius(Vector3)

public bool IsWithinRadius(Vector3 point)

Parameters

point Vector3

Returns

bool

NotifySuppliesChanged(SupplyType, float)

protected virtual void NotifySuppliesChanged(SupplyType supplyType, float change)

Parameters

supplyType SupplyType
change float

OnDeployTo(WarfarePlayer, in DeploySettings)

protected virtual void OnDeployTo(WarfarePlayer player, in DeploySettings settings)

Parameters

player WarfarePlayer
settings DeploySettings

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Translate(ITranslationValueFormatter, in ValueFormatParameters)

Allows objects to define how they're translated in their own definition instead of creating a value converter.

public string Translate(ITranslationValueFormatter formatter, in ValueFormatParameters parameters)

Parameters

formatter ITranslationValueFormatter
parameters ValueFormatParameters

Returns

string

UpdateConfiguration(FobConfiguration)

Called when the FobConfiguration is updated.

public virtual void UpdateConfiguration(FobConfiguration configuration)

Parameters

configuration FobConfiguration

UpdateIcon()

protected void UpdateIcon()