C# Class PlayerAction, tf_client

Inheritance: MonoBehaviour
Afficher le fichier Open project: wids-eria/tf_client Class Usage Examples

Méthodes publiques

Свойство Type Description
allowPerformance bool
controlsAreaHeight float
cost int
dialogConfirmButtonDo GUIContent
dialogLongDescription string
effectPrefab GameObject
hasServerAPIPoint bool
icon UnityEngine.Texture2D
inputMode InputMode
notificationMessage string
tooltip string

Protected Properties

Свойство Type Description
downloadTilesCoroutine DownloadTilesInRegionCoroutine
m_actionProgress float
m_tileModifications ResourceTileModification

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
DisplayControls ( ) : void

Configure the dialog

DoAction ( GUIButtonBase, button ) : void
DoIt ( object selection ) : void

Perform the action.

IsPermittedOnResourceTile ( ResourceTile, tile ) : bool

Determines whether this action is permitted on the specified tile.

OnEnable ( ) : void

Raises the enable event.

OnGUI ( ) : void

Display loading icon as needed

Start ( ) : void
UpdateMask ( ) : void

Updates the mask.

UpdateSelectionHighlighter ( ) : void

Updates the selection highlighter.

Méthodes protégées

Méthode Description
BeginGUIArea ( ) : void

Begins the GUI area.

CalculateCost ( ResourceTileLite, tiles ) : int

Calculates the cost of performing this action on the given tiles

ConcludeActionOnResourceTiles ( ResourceTileSelection, selection ) : void

Concludes the action on resource tiles.

DisplayControlsContents ( ) : void

Displays the controls contents.

DisplayPaintSelectionControlGroup ( ) : void

Displays the paint selection control group.

DoItButton ( ) : void

The button to perform the action.

DoResourceCalculations ( ResourceTileSelection, selection ) : bool
EndGUIArea ( ) : void

Ends the GUI area.

GetActionJson ( ) : string

Gets JSON representation for the action.

Creates a JSON object for use with god mode.

GetActionJson ( object mods ) : string
GetDoItWWW ( ResourceTileSelection, selection ) : WWW

Gets the do it WWW.

GetEffectSpawnLocationsFromResourceTiles ( ResourceTileSelection, selection ) : Vector3[]

Gets the effect spawn locations from resource tiles.

Put ( ResourceTileSelection, selection ) : IEnumerator

Forces a put of resource tile modifications using god mode.

This is a temporary solution for implementing actions with no server API point, and can eventually be removed.

Refresh ( ) : IEnumerator
RefreshAfterActionFailed ( string errorMessage ) : IEnumerator

Refreshs after the action failed.

SendActionMessage ( ResourceTile, modifiedTiles ) : void

Sends out a message stating that an action was performed

SpawnEffectsAtLocations ( Vector3 spawnLocations ) : void

Spawns the effects at locations.

SubmitResourceTileSelection ( ResourceTileSelection, selection ) : void

Submits the resource tile selection.

NOTE: This may need a more sophisticated implementation if e.g., player action changes before server responds.

SubmitResourceTileSelectionToServerAPI ( ResourceTileSelection, selection ) : IEnumerator

Submits the resource tile selection to server API.

Method Details

BeginGUIArea() protected méthode

Begins the GUI area.
protected BeginGUIArea ( ) : void
Résultat void

CalculateCost() protected méthode

Calculates the cost of performing this action on the given tiles
protected CalculateCost ( ResourceTileLite, tiles ) : int
tiles ResourceTileLite, /// Tiles. ///
Résultat int

ConcludeActionOnResourceTiles() protected méthode

Concludes the action on resource tiles.
protected ConcludeActionOnResourceTiles ( ResourceTileSelection, selection ) : void
selection ResourceTileSelection, /// Tiles. ///
Résultat void

DisplayControls() public méthode

Configure the dialog
public DisplayControls ( ) : void
Résultat void

DisplayControlsContents() protected méthode

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

DisplayPaintSelectionControlGroup() protected méthode

Displays the paint selection control group.
protected DisplayPaintSelectionControlGroup ( ) : void
Résultat void

DoAction() public méthode

public DoAction ( GUIButtonBase, button ) : void
button GUIButtonBase,
Résultat void

DoIt() public méthode

Perform the action.
public DoIt ( object selection ) : void
selection object /// The selection to which the action should be applied. ///
Résultat void

DoItButton() protected méthode

The button to perform the action.
protected DoItButton ( ) : void
Résultat void

DoResourceCalculations() protected méthode

protected DoResourceCalculations ( ResourceTileSelection, selection ) : bool
selection ResourceTileSelection,
Résultat bool

EndGUIArea() protected méthode

Ends the GUI area.
protected EndGUIArea ( ) : void
Résultat void

GetActionJson() protected méthode

Gets JSON representation for the action.
Creates a JSON object for use with god mode.
protected GetActionJson ( ) : string
Résultat string

GetActionJson() protected méthode

protected GetActionJson ( object mods ) : string
mods object
Résultat string

GetDoItWWW() protected méthode

Gets the do it WWW.
protected GetDoItWWW ( ResourceTileSelection, selection ) : WWW
selection ResourceTileSelection, /// The selection. ///
Résultat WWW

GetEffectSpawnLocationsFromResourceTiles() protected méthode

Gets the effect spawn locations from resource tiles.
protected GetEffectSpawnLocationsFromResourceTiles ( ResourceTileSelection, selection ) : Vector3[]
selection ResourceTileSelection, /// Tiles. ///
Résultat Vector3[]

IsPermittedOnResourceTile() public abstract méthode

Determines whether this action is permitted on the specified tile.
public abstract 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

OnGUI() public méthode

Display loading icon as needed
public OnGUI ( ) : void
Résultat void

Put() protected méthode

Forces a put of resource tile modifications using god mode.
This is a temporary solution for implementing actions with no server API point, and can eventually be removed.
protected Put ( ResourceTileSelection, selection ) : IEnumerator
selection ResourceTileSelection, /// The selection. ///
Résultat IEnumerator

Refresh() protected méthode

protected Refresh ( ) : IEnumerator
Résultat IEnumerator

RefreshAfterActionFailed() protected méthode

Refreshs after the action failed.
protected RefreshAfterActionFailed ( string errorMessage ) : IEnumerator
errorMessage string /// Error message. ///
Résultat IEnumerator

SendActionMessage() protected méthode

Sends out a message stating that an action was performed
protected SendActionMessage ( ResourceTile, modifiedTiles ) : void
modifiedTiles ResourceTile,
Résultat void

SpawnEffectsAtLocations() protected méthode

Spawns the effects at locations.
protected SpawnEffectsAtLocations ( Vector3 spawnLocations ) : void
spawnLocations Vector3 /// Spawn locations. ///
Résultat void

Start() public méthode

public Start ( ) : void
Résultat void

SubmitResourceTileSelection() protected méthode

Submits the resource tile selection.
NOTE: This may need a more sophisticated implementation if e.g., player action changes before server responds.
protected SubmitResourceTileSelection ( ResourceTileSelection, selection ) : void
selection ResourceTileSelection, /// The resource tile selection. ///
Résultat void

SubmitResourceTileSelectionToServerAPI() protected méthode

Submits the resource tile selection to server API.
protected SubmitResourceTileSelectionToServerAPI ( ResourceTileSelection, selection ) : IEnumerator
selection ResourceTileSelection, /// The resource tile selection. ///
Résultat IEnumerator

UpdateMask() public méthode

Updates the mask.
public UpdateMask ( ) : void
Résultat void

UpdateSelectionHighlighter() public méthode

Updates the selection highlighter.
public UpdateSelectionHighlighter ( ) : void
Résultat void

Property Details

allowPerformance public_oe property

public bool allowPerformance
Résultat bool

controlsAreaHeight public_oe property

The height of the controls area.
public float controlsAreaHeight
Résultat float

cost public_oe property

the base cost to perform the action; modify in GatherData if it is variable
public int cost
Résultat int

dialogConfirmButtonDo public_oe property

Labels to appear on the submission button.
public GUIContent dialogConfirmButtonDo
Résultat GUIContent

dialogLongDescription public_oe property

long description to appear under the question in the dialog
public string dialogLongDescription
Résultat string

downloadTilesCoroutine protected_oe property

protected DownloadTilesInRegionCoroutine downloadTilesCoroutine
Résultat DownloadTilesInRegionCoroutine

effectPrefab public_oe property

Prefab for the special effect to spawn, if any
public GameObject effectPrefab
Résultat GameObject

hasServerAPIPoint public_oe property

Flag specifying whether or not the action has a server API point.
When this is false, the action uses a god mode implementation. It will eventually be removed once every action has an API point.
public bool hasServerAPIPoint
Résultat bool

icon public_oe property

the icon associated with this action
public Texture2D,UnityEngine icon
Résultat UnityEngine.Texture2D

inputMode public_oe property

The input mode.
public InputMode inputMode
Résultat InputMode

m_actionProgress protected_oe property

The action progress.
protected float m_actionProgress
Résultat float

m_tileModifications protected_oe property

The tile modifications wrapper.
protected ResourceTileModification m_tileModifications
Résultat ResourceTileModification

notificationMessage public_oe property

public string notificationMessage
Résultat string

tooltip public_oe property

description of what the action does
public string tooltip
Résultat string