Class FuelSupplyComponent
Stores fuel and provides energy to consuming components. Persists the active fuel item across pickup/putdown.
Inheritance
System.Object
FuelSupplyComponent
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
[RequireComponent]
[DefaultToUnlinked]
public class FuelSupplyComponent : StorageComponent, ILinkable, IOwned, IController, IViewController, IHasUniversalID, IHasSerializableID, IRPCAuthChecks, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, IHasInteractions, IInventoryWorldObjectComponent, IPermanentDestroyHandler, ICanOverrideAuth, INotifyPropertyChanged, IHasEnvVars, IPersistentData
Constructors
FuelSupplyComponent()
Declaration
public FuelSupplyComponent()
FuelSupplyComponent(Int32, String[])
Declaration
public FuelSupplyComponent(int numFuelSlots, params string[] fuelTags)
Parameters
| Type |
Name |
Description |
| System.Int32 |
numFuelSlots |
|
| System.String[] |
fuelTags |
|
Properties
Availability
Declaration
public override WorldObjectComponentClientAvailability Availability { get; }
Property Value
Overrides
ConsumptionRate
Declaration
public float ConsumptionRate { get; }
Property Value
| Type |
Description |
| System.Single |
|
CurrentFuel
Declaration
public Item CurrentFuel { get; }
Property Value
Enabled
Declaration
public override bool Enabled { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Overrides
Energy
Declaration
public float Energy { get; }
Property Value
| Type |
Description |
| System.Single |
|
EnergyInSupply
Declaration
public float EnergyInSupply { get; }
Property Value
| Type |
Description |
| System.Single |
|
Declaration
public IEnumerable<string> FuelTags { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.IEnumerable<System.String> |
|
FuelTypesString
Declaration
public string FuelTypesString { get; }
Property Value
| Type |
Description |
| System.String |
|
HighestValueFuel
Declaration
public Item HighestValueFuel { get; }
Property Value
IconName
Declaration
public override string IconName { get; }
Property Value
| Type |
Description |
| System.String |
|
Overrides
Inventory
Declaration
public override Inventory Inventory { get; }
Property Value
Overrides
PeakEnergy
Declaration
public float PeakEnergy { get; }
Property Value
| Type |
Description |
| System.Single |
|
PersistentData
Declaration
public object PersistentData { get; set; }
Property Value
| Type |
Description |
| System.Object |
|
Methods
CanConsumeFuel(Single)
Checks whether it's possible for the component to burn provided amount of energy.
Declaration
public bool CanConsumeFuel(float joules)
Parameters
| Type |
Name |
Description |
| System.Single |
joules |
|
Returns
| Type |
Description |
| System.Boolean |
|
CanPutIntoFuelTank(User)
Declaration
[EnvVar]
public bool CanPutIntoFuelTank(User user)
Parameters
| Type |
Name |
Description |
| User |
user |
|
Returns
| Type |
Description |
| System.Boolean |
|
ConsumeAsMuchAsPossible(Single)
Consumes as much joules as possible and returns actually consumed joules. It tries to load fuel from inventory when Energy fully consumed.
Declaration
public float ConsumeAsMuchAsPossible(float joules)
Parameters
| Type |
Name |
Description |
| System.Single |
joules |
|
Returns
| Type |
Description |
| System.Single |
|
Destroy()
Declaration
public override void Destroy()
Overrides
Initialize()
Declaration
public override void Initialize()
Overrides
Initialize(Int32, String[])
Declaration
public void Initialize(int numFuelSlots, string[] fuelTags)
Parameters
| Type |
Name |
Description |
| System.Int32 |
numFuelSlots |
|
| System.String[] |
fuelTags |
|
LateTick()
Declaration
public override void LateTick()
Overrides
PutItem(Player, InteractionTriggerInfo, InteractionTarget)
Declaration
[Interaction]
public void PutItem(Player player, InteractionTriggerInfo trigger, InteractionTarget target)
Parameters
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods