C# Class PlayerActionHarvestTimber, tf_client

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

Méthodes publiques

Свойство Type Description
timeToWaitForRefresh float

Protected Properties

Свойство Type Description
m_actualFrequencyDistributionOfSelectedTiles int[]
m_cutType CutType
m_desiredTreeValues int[]
m_histogramHeight float
m_histogramRect Rect
m_knownFrequencyDistributionOfSelectedTiles int[]
m_needSurveyMessageRect Rect

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode 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 méthode

Listen for input messages.
protected Awake ( ) : void
Résultat void

DisplayControlsContents() protected méthode

Displays the controls contents.
protected DisplayControlsContents ( ) : void
Résultat void

DisplayCutSelector() protected méthode

Displays the cut selector.
protected DisplayCutSelector ( ) : void
Résultat void

DisplayHistogram() public static méthode

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. ///
Résultat void

DisplayOperationCost() protected méthode

Displays the operation cost.
protected DisplayOperationCost ( ) : void
Résultat void

DoIt() public méthode

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

FilterSelection() protected méthode

HACK
protected FilterSelection ( ResourceTileSelection, selection ) : ResourceTileSelection,
selection ResourceTileSelection, /// Selection. ///
Résultat ResourceTileSelection,

IsPermittedOnResourceTile() public méthode

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

OnEnable() public méthode

Raises the enable event.
public OnEnable ( ) : void
Résultat void

SendActionMessage() protected méthode

protected SendActionMessage ( ResourceTile, modifiedTiles ) : void
modifiedTiles ResourceTile,
Résultat void

SubmitResourceTileSelectionToServerAPI() protected méthode

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. ///
Résultat IEnumerator

Update() protected méthode

Refresh the info for the selection as needed.
protected Update ( ) : void
Résultat void

Property Details

m_actualFrequencyDistributionOfSelectedTiles protected_oe property

protected int[] m_actualFrequencyDistributionOfSelectedTiles
Résultat int[]

m_cutType protected_oe property

The type of the cut.
protected CutType m_cutType
Résultat 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
Résultat int[]

m_histogramHeight protected_oe static_oe property

The height of the histogram.
protected static float m_histogramHeight
Résultat float

m_histogramRect protected_oe static_oe property

The histogram rect.
protected static Rect m_histogramRect
Résultat Rect

m_knownFrequencyDistributionOfSelectedTiles protected_oe property

The known frequency distribution of selected tiles.
protected int[] m_knownFrequencyDistributionOfSelectedTiles
Résultat int[]

m_needSurveyMessageRect protected_oe static_oe property

protected static Rect m_needSurveyMessageRect
Résultat Rect

timeToWaitForRefresh public_oe property

The time to wait for refreshing data on the current select.
public float timeToWaitForRefresh
Résultat float