Class SolarGeneratorComponent
A component that will adjust the power output of an object that requires a view of the sun.
Inheritance
System.Object
SolarGeneratorComponent
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
[RequireComponent]
[RequireComponent]
public class SolarGeneratorComponent : WorldObjectComponent, ILinkable, IOwned, IController, IViewController, IHasUniversalID, IHasSerializableID, IRPCAuthChecks, INotifyPropertyChanged, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, IHasInteractions, IChunkSubscriber
Constructors
SolarGeneratorComponent()
Declaration
public SolarGeneratorComponent()
Properties
Enabled
Declaration
public override bool Enabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
LastChunkUpdateTime
Declaration
public double LastChunkUpdateTime { get; set; }
Property Value
Type |
Description |
System.Double |
|
MaxQueuedChunkUpdateTime
Declaration
public float MaxQueuedChunkUpdateTime { get; }
Property Value
Type |
Description |
System.Single |
|
QueuedChunkUpdateTime
Declaration
public double QueuedChunkUpdateTime { get; set; }
Property Value
Type |
Description |
System.Double |
|
UpdateFrequencySec
Declaration
public float UpdateFrequencySec { get; }
Property Value
Type |
Description |
System.Single |
|
Methods
ChunksChanged()
Trigger the associated behavior if the chunks in RelevantChunkPositions are changed.
Declaration
public void ChunksChanged()
Initialize()
Declaration
public override void Initialize()
Overrides
RelevantChunkPositions()
Declaration
public List<Vector3i> RelevantChunkPositions()
Returns
Type |
Description |
System.Collections.Generic.List<Vector3i> |
|
SkyTest()
Adjusts power output based on this generators view of the sky.
Calculated by selecting each block occupied in a horizontal footprint and checking if it is the top block or not.
OutputPower = InitializedPower * PercentUncovered
Declaration
UpdateChunkSubscriptions()
Checks if there are any new chunks in the columns this generator occupies and subscribes to them.
Declaration
public void UpdateChunkSubscriptions()
Explicit Interface Implementations
IChunkSubscriber.RelevantChunkPositions()
Declaration
IEnumerable<Vector3i> IChunkSubscriber.RelevantChunkPositions()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Vector3i> |
|
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods