C# Класс PlayerActionHarvestTimber, tf_client

An action for enacting a harvesting strategy on a section of land.
Наследование: PlayerAction
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
timeToWaitForRefresh float

Защищенные свойства (Protected)

Свойство Тип Описание
m_actualFrequencyDistributionOfSelectedTiles int[]
m_cutType CutType
m_desiredTreeValues int[]
m_histogramHeight float
m_histogramRect Rect
m_knownFrequencyDistributionOfSelectedTiles int[]
m_needSurveyMessageRect Rect

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

Awake() защищенный Метод

Listen for input messages.
protected Awake ( ) : void
Результат void

DisplayControlsContents() защищенный Метод

Displays the controls contents.
protected DisplayControlsContents ( ) : void
Результат void

DisplayCutSelector() защищенный Метод

Displays the cut selector.
protected DisplayCutSelector ( ) : void
Результат void

DisplayHistogram() публичный статический Метод

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. ///
Результат void

DisplayOperationCost() защищенный Метод

Displays the operation cost.
protected DisplayOperationCost ( ) : void
Результат void

DoIt() публичный Метод

Configure modifications then call base implementation.
public DoIt ( object selection ) : void
selection object /// The selection to which the action should be applied. ///
Результат void

FilterSelection() защищенный Метод

HACK
protected FilterSelection ( ResourceTileSelection, selection ) : ResourceTileSelection,
selection ResourceTileSelection, /// Selection. ///
Результат ResourceTileSelection,

IsPermittedOnResourceTile() публичный Метод

Determines whether this action is permitted on the specified tile.
public IsPermittedOnResourceTile ( ResourceTile, tile ) : bool
tile ResourceTile, /// The resource tile in question. ///
Результат bool

OnEnable() публичный Метод

Raises the enable event.
public OnEnable ( ) : void
Результат void

SendActionMessage() защищенный Метод

protected SendActionMessage ( ResourceTile, modifiedTiles ) : void
modifiedTiles ResourceTile,
Результат void

SubmitResourceTileSelectionToServerAPI() защищенный Метод

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. ///
Результат IEnumerator

Update() защищенный Метод

Refresh the info for the selection as needed.
protected Update ( ) : void
Результат void

Описание свойств

m_actualFrequencyDistributionOfSelectedTiles защищенное свойство

protected int[] m_actualFrequencyDistributionOfSelectedTiles
Результат int[]

m_cutType защищенное свойство

The type of the cut.
protected CutType m_cutType
Результат CutType

m_desiredTreeValues защищенное свойство

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
Результат int[]

m_histogramHeight защищенное статическое свойство

The height of the histogram.
protected static float m_histogramHeight
Результат float

m_histogramRect защищенное статическое свойство

The histogram rect.
protected static Rect m_histogramRect
Результат Rect

m_knownFrequencyDistributionOfSelectedTiles защищенное свойство

The known frequency distribution of selected tiles.
protected int[] m_knownFrequencyDistributionOfSelectedTiles
Результат int[]

m_needSurveyMessageRect защищенное статическое свойство

protected static Rect m_needSurveyMessageRect
Результат Rect

timeToWaitForRefresh публичное свойство

The time to wait for refreshing data on the current select.
public float timeToWaitForRefresh
Результат float