Class ResourceFob
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
serviceProviderIServiceProvidernamestringbuildableIBuildable
Fields
FobManager
protected readonly FobManager FobManager
Field Value
Properties
AmmoCount
public float AmmoCount { get; }
Property Value
BuildCount
public float BuildCount { get; }
Property Value
Buildable
public IBuildable Buildable { get; protected set; }
Property Value
EffectiveRadius
public virtual float EffectiveRadius { get; }
Property Value
FriendlyProximity
public ISphereProximity FriendlyProximity { get; }
Property Value
Icon
public WorldIconInfo? Icon { get; }
Property Value
IsProxied
public bool IsProxied { get; }
Property Value
Name
The display name of the FOB on the FOB list.
public string Name { get; }
Property Value
NearbyEnemies
public ProximityCollector<WarfarePlayer> NearbyEnemies { get; }
Property Value
NearbyFriendlies
public ProximityCollector<WarfarePlayer> NearbyFriendlies { get; }
Property Value
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
Yaw
The angle the player will spawn along the Y-axis.
public float Yaw { get; }
Property Value
Methods
ChangeSupplies(SupplyType, float)
public void ChangeSupplies(SupplyType supplyType, float amount)
Parameters
supplyTypeSupplyTypeamountfloat
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
playerWarfarePlayerchatServiceChatServicetranslationsDeploymentTranslationssettingsDeploySettingsdeployingToIDeployable
Returns
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
playerWarfarePlayerchatServiceChatServicetranslationsDeploymentTranslationssettingsDeploySettings
Returns
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
playerWarfarePlayerchatServiceChatServicetranslationsDeploymentTranslationssettingsDeploySettings
Returns
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
isDisposingbool
EnumerateEntities()
public IEnumerable<IFobEntity> EnumerateEntities()
Returns
GetColor(Team)
Gets the display color of this FOB on the FOB list.
public virtual Color32 GetColor(Team viewingTeam)
Parameters
viewingTeamTeam
Returns
- Color32
GetDelay(WarfarePlayer)
Get the deployment delay in seconds.
public virtual TimeSpan GetDelay(WarfarePlayer player)
Parameters
playerWarfarePlayer
Returns
IsVisibleToPlayer(WarfarePlayer)
Whether the specified player should be able to see this fob on their FOB HUD.
public virtual bool IsVisibleToPlayer(WarfarePlayer player)
Parameters
playerWarfarePlayer
Returns
IsWithinRadius(Vector3)
public bool IsWithinRadius(Vector3 point)
Parameters
pointVector3
Returns
NotifySuppliesChanged(SupplyType, float)
protected virtual void NotifySuppliesChanged(SupplyType supplyType, float change)
Parameters
supplyTypeSupplyTypechangefloat
OnDeployTo(WarfarePlayer, in DeploySettings)
protected virtual void OnDeployTo(WarfarePlayer player, in DeploySettings settings)
Parameters
playerWarfarePlayersettingsDeploySettings
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
formatterITranslationValueFormatterparametersValueFormatParameters
Returns
UpdateConfiguration(FobConfiguration)
Called when the FobConfiguration is updated.
public virtual void UpdateConfiguration(FobConfiguration configuration)
Parameters
configurationFobConfiguration
UpdateIcon()
protected void UpdateIcon()