A class in Root.Township, Alta.Blacksmithing.
One point on a piece of forged metal that fills as it is hammered while hot. Synced and saved as a child of the forged item, and drives its shape colouring.
Constructors
| Member | What it is |
|---|
ForgedPoint() | Creates a ForgedPoint with default values. |
Fields
7 private and internal fields
| Member | What it is |
|---|
private float completeAreaToThicknessMultiplier | Heat conductivity multiplier when fully forged. |
private MetalHeatPoint heatPoint | Backing field for HeatPoint. |
private float incompleteAreaToThicknessMultiplier | Heat conductivity multiplier when not forged at all. |
private bool isChangedSyncLastSync | True when progress changed since the last sync. |
private bool isFinished | True once progress reaches 1, so it syncs as finished. |
private float progress | Backing field for Progress. |
private float progressMultiplier | How much hammer damage adds to progress, also scaled by the metal's glow. |
Properties
| Member | What it is |
|---|
NetworkEntity Entity { get; set; } | The forged item's entity. |
float Glow { get; } | How hot the point is, from its heat point. Hammering scales with it. |
MetalHeatPoint HeatPoint { get; } | The MetalHeatPoint on the same object. |
float Progress { get; set; } | How forged the point is, from 0 to 1. Also changes the heat point's conductivity. |
Events
| Member | What it is |
|---|
event Action<ForgedPoint> Changed | Raised when progress changes. |
Methods
| Member | What it is |
|---|
void CopyFrom(ForgedPoint other) | Copies another point's progress. |
void Initialize(ChildSyncableCollectionBase<ForgedPoint> collection) | Does nothing. |
void InitializeAsServer(SpawnData spawnData) | Does nothing. |
bool IsEqual(ForgedPoint other) | True if both points have the same progress. |
bool IsNeedingSync() | True if progress changed since the last sync. |
void Sync(IPlayer player, Stream stream) | Writes or reads progress, as a finished flag or a 0 to 1 value. Remote clients apply it. |
void TakeDamage(float damage) | Server: adds damage times the multiplier times the glow. 0.99 or more counts as finished. |
1 private and internal method
| Member | What it is |
|---|
private void OnChanged() | Marks the point for sync, updates the heat point's thickness conductivity from progress and fires Changed. |
Used in
Members of other types that take, return or hold a ForgedPoint: