File upandaway/components/staticgenerator.lua

The StaticGenerator component.
Pushes the events "upandaway_charge", "upandaway_uncharge" and "upandaway_chargechange".

Author:

simplex

Functions

StaticGenerator:Charge () Goes to the CHARGED state.
StaticGenerator:IsCharged () Returns whether the prefab is CHARGED.
StaticGenerator:LongUpdate (dt) Handles long updates by simply going to the UNCHARGED state.
StaticGenerator:OnLoad (data) Loads the saved state and goes to it.
StaticGenerator:OnSave () Saves the current state.
StaticGenerator:SetAverageChargedTime (dt) Sets the average duration of the CHARGED state.
StaticGenerator:SetAverageUnchargedTime (dt) Sets the average duration of the UNCHARGED state.
StaticGenerator:StartGenerating () Starts updating the state transition.
StaticGenerator:StopGenerating () Halts the updating of the state transition.
StaticGenerator:Toggle () Goes to the other state.
StaticGenerator:Uncharge () Goes to the UNCHARGED state.

Tables

StaticGenerator The StaticGenerator component.


Functions

StaticGenerator:Charge ()
Goes to the CHARGED state.
StaticGenerator:IsCharged ()
Returns whether the prefab is CHARGED.

Return value:

A boolean, representing the state.
StaticGenerator:LongUpdate (dt)
Handles long updates by simply going to the UNCHARGED state.

Parameters

  • dt:
StaticGenerator:OnLoad (data)
Loads the saved state and goes to it.

Parameters

  • data:
StaticGenerator:OnSave ()
Saves the current state.
StaticGenerator:SetAverageChargedTime (dt)
Sets the average duration of the CHARGED state.

Parameters

  • dt: Average duration, in seconds.
StaticGenerator:SetAverageUnchargedTime (dt)
Sets the average duration of the UNCHARGED state.

Parameters

  • dt: Average duration, in seconds.
StaticGenerator:StartGenerating ()
Starts updating the state transition.
StaticGenerator:StopGenerating ()
Halts the updating of the state transition.
StaticGenerator:Toggle ()
Goes to the other state.
StaticGenerator:Uncharge ()
Goes to the UNCHARGED state.

Tables

StaticGenerator
The StaticGenerator component.
Pushes the events "upandaway_charge", "upandaway_uncharge" and "upandaway_chargechange".

Valid XHTML 1.0!