C# Class PlayerActionHarvestTimber, tf_client

An action for enacting a harvesting strategy on a section of land.
Inheritance: PlayerAction
Exibir arquivo Open project: wids-eria/tf_client

Public Properties

Property Type Description
timeToWaitForRefresh float

Protected Properties

Property Type Description
m_actualFrequencyDistributionOfSelectedTiles int[]
m_cutType CutType
m_desiredTreeValues int[]
m_histogramHeight float
m_histogramRect Rect
m_knownFrequencyDistributionOfSelectedTiles int[]
m_needSurveyMessageRect Rect

Public Methods

Method Description
DisplayHistogram ( int treesToKeep, int treesToCut, float progress ) : void

Displays the histogram.

Presently, implicitly assumes that both arrays have length of ResourceTile.treeSizeClassCount and that all values are >= 0. KNOW YOUR DATA BRO.

DoIt ( object selection ) : void

Configure modifications then call base implementation.

IsPermittedOnResourceTile ( ResourceTile, tile ) : bool

Determines whether this action is permitted on the specified tile.

OnEnable ( ) : void

Raises the enable event.

Protected Methods

Method Description
Awake ( ) : void

Listen for input messages.

DisplayControlsContents ( ) : void

Displays the controls contents.

DisplayCutSelector ( ) : void

Displays the cut selector.

DisplayOperationCost ( ) : void

Displays the operation cost.

FilterSelection ( ResourceTileSelection, selection ) : ResourceTileSelection,

HACK

SendActionMessage ( ResourceTile, modifiedTiles ) : void
SubmitResourceTileSelectionToServerAPI ( ResourceTileSelection, selection ) : IEnumerator

Submits the resource tile selection to server API.

This differs from the base implementation because the API returns timber values, not modified resource tiles

Update ( ) : void

Refresh the info for the selection as needed.

Private Methods

Method Description
ClearFrequencyDistribution ( ) : void

Clears the frequency distribution.

ComputeTreesToBeCut ( int &treesToCut, int &treesToKeep ) : void

Computes the trees to be cut.

ComputeTreesToBeCut ( int frequencyDistribution, int &treesToCut, int &treesToKeep ) : void

Computes the trees to be cut (Overload function).

InitializeQRatioCurve ( ) : void

Initializes the Q ratio curve.

RefreshDataForSelection ( ResourceTileSelection, selection ) : IEnumerator

Refreshs the data for selection.

Start ( ) : void

Initialize q ratio curve.

Method Details

Awake() protected method

Listen for input messages.
protected Awake ( ) : void
return void

DisplayControlsContents() protected method

Displays the controls contents.
protected DisplayControlsContents ( ) : void
return void

DisplayCutSelector() protected method

Displays the cut selector.
protected DisplayCutSelector ( ) : void
return void

DisplayHistogram() public static method

Displays the histogram.
Presently, implicitly assumes that both arrays have length of ResourceTile.treeSizeClassCount and that all values are >= 0. KNOW YOUR DATA BRO.
public static DisplayHistogram ( int treesToKeep, int treesToCut, float progress ) : void
treesToKeep int /// Trees to keep. ///
treesToCut int /// Trees to cut. ///
progress float /// Normalized progress. ///
return void

DisplayOperationCost() protected method

Displays the operation cost.
protected DisplayOperationCost ( ) : void
return void

DoIt() public method

Configure modifications then call base implementation.
public DoIt ( object selection ) : void
selection object /// The selection to which the action should be applied. ///
return void

FilterSelection() protected method

HACK
protected FilterSelection ( ResourceTileSelection, selection ) : ResourceTileSelection,
selection ResourceTileSelection, /// Selection. ///
return ResourceTileSelection,

IsPermittedOnResourceTile() public method

Determines whether this action is permitted on the specified tile.
public IsPermittedOnResourceTile ( ResourceTile, tile ) : bool
tile ResourceTile, /// The resource tile in question. ///
return bool

OnEnable() public method

Raises the enable event.
public OnEnable ( ) : void
return void

SendActionMessage() protected method

protected SendActionMessage ( ResourceTile, modifiedTiles ) : void
modifiedTiles ResourceTile,
return void

SubmitResourceTileSelectionToServerAPI() protected method

Submits the resource tile selection to server API.
This differs from the base implementation because the API returns timber values, not modified resource tiles
protected SubmitResourceTileSelectionToServerAPI ( ResourceTileSelection, selection ) : IEnumerator
selection ResourceTileSelection, /// The resource tile selection. ///
return IEnumerator

Update() protected method

Refresh the info for the selection as needed.
protected Update ( ) : void
return void

Property Details

m_actualFrequencyDistributionOfSelectedTiles protected_oe property

protected int[] m_actualFrequencyDistributionOfSelectedTiles
return int[]

m_cutType protected_oe property

The type of the cut.
protected CutType m_cutType
return CutType

m_desiredTreeValues protected_oe property

The desired tree values.
This is only used in god mode, and can be discarded when it is no longer used.
protected int[] m_desiredTreeValues
return int[]

m_histogramHeight protected_oe static_oe property

The height of the histogram.
protected static float m_histogramHeight
return float

m_histogramRect protected_oe static_oe property

The histogram rect.
protected static Rect m_histogramRect
return Rect

m_knownFrequencyDistributionOfSelectedTiles protected_oe property

The known frequency distribution of selected tiles.
protected int[] m_knownFrequencyDistributionOfSelectedTiles
return int[]

m_needSurveyMessageRect protected_oe static_oe property

protected static Rect m_needSurveyMessageRect
return Rect

timeToWaitForRefresh public_oe property

The time to wait for refreshing data on the current select.
public float timeToWaitForRefresh
return float