C# Class PathfindingTest.Players.Player

Inheritance: MouseClickListener, MouseMotionListener
Exibir arquivo Open project: Wotuu/RTS_XNA_v2 Class Usage Examples

Public Properties

Property Type Description
alliance Alliance
arrowManager ArrowManager
color Color
device GraphicsDevice
fastStore UnitStore
lightTexture Microsoft.Xna.Framework.Graphics.Texture2D
meleeStore UnitStore
rangedStore UnitStore

Private Properties

Property Type Description
Draw void

Public Methods

Method Description
DeselectAllBuildings ( ) : void

Deselects all buildings.

DeselectAllUnits ( ) : void

Deselects all units.

DrawHud ( SpriteBatch sb ) : void
DrawLights ( GameTime gameTime, SpriteBatch spriteBatch, Microsoft.Xna.Framework.Graphics.Texture2D lightTexture ) : void
DrawLights ( SpriteBatch spriteBatch ) : void
DrawMiniLights ( SpriteBatch spriteBatch, MiniMap map ) : void
GetAddedOffsettedMouseLocation ( MouseEvent m ) : Point

Gets the mouse location with the offset added.

GetBuildings ( ) : BuildingSelection
GetMouseOverBuilding ( CustomArrayList buildings ) : PathfindingTest.Buildings.Building

Whether the mouse is over a unit or not if it is, it'll return it. =D

GetMouseOverUnit ( ) : Unit

Gets the unit that the mouse is over, of all players.

GetMouseOverUnit ( CustomArrayList units ) : Unit

Whether the mouse is over a unit or not if it is, it'll return it. =D

GetNewPreviewPattern ( Point patternCenterLocation, Point offsettedMouseLocation, int angle ) : UnitGroupPattern

Gets the new current preview pattern (TEMPORARY FUNCTION)

GetSelectedBuildings ( ) : BuildingSelection
GetSelectedUnits ( ) : UnitSelection
GetSubstractedOffsettedMouseLocation ( MouseEvent m ) : Point

Gets the mouse location with the offset substracted.

GetUnits ( ) : UnitSelection
IsMouseOverFriendlyBuilding ( ) : PathfindingTest.Buildings.Building
IsPreviewingBuilding ( ) : System.Boolean

Whether the player is currently previewing a building

OnMouseClick ( MouseEvent m ) : void
OnMouseDrag ( MouseEvent m ) : void
OnMouseMotion ( MouseEvent m ) : void
OnMouseRelease ( MouseEvent m ) : void
Player ( Alliance alliance, Color color, Point startLocation ) : System

Player constructor.

RemovePreviewBuildings ( ) : void

Removes all the preview buildings

SpawnStartUnits ( ) : void

Spawns the starting units of this player.

Update ( KeyboardState ks, Microsoft.Xna.Framework.Input.MouseState ms ) : void

Standard Update function.

stopUnitSelection ( ) : void

Private Methods

Method Description
Draw ( SpriteBatch sb ) : void

Standard Draw function.

Method Details

DeselectAllBuildings() public method

Deselects all buildings.
public DeselectAllBuildings ( ) : void
return void

DeselectAllUnits() public method

Deselects all units.
public DeselectAllUnits ( ) : void
return void

DrawHud() public method

public DrawHud ( SpriteBatch sb ) : void
sb Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

DrawLights() public method

public DrawLights ( GameTime gameTime, SpriteBatch spriteBatch, Microsoft.Xna.Framework.Graphics.Texture2D lightTexture ) : void
gameTime Microsoft.Xna.Framework.GameTime
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
lightTexture Microsoft.Xna.Framework.Graphics.Texture2D
return void

DrawLights() public method

public DrawLights ( SpriteBatch spriteBatch ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

DrawMiniLights() public method

public DrawMiniLights ( SpriteBatch spriteBatch, MiniMap map ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
map MiniMap
return void

GetAddedOffsettedMouseLocation() public method

Gets the mouse location with the offset added.
public GetAddedOffsettedMouseLocation ( MouseEvent m ) : Point
m MouseEvent The mouse event.
return Point

GetBuildings() public method

public GetBuildings ( ) : BuildingSelection
return PathfindingTest.Selection.BuildingSelection

GetMouseOverBuilding() public method

Whether the mouse is over a unit or not if it is, it'll return it. =D
public GetMouseOverBuilding ( CustomArrayList buildings ) : PathfindingTest.Buildings.Building
buildings CustomArrayList
return PathfindingTest.Buildings.Building

GetMouseOverUnit() public method

Gets the unit that the mouse is over, of all players.
public GetMouseOverUnit ( ) : Unit
return PathfindingTest.Units.Unit

GetMouseOverUnit() public method

Whether the mouse is over a unit or not if it is, it'll return it. =D
public GetMouseOverUnit ( CustomArrayList units ) : Unit
units CustomArrayList
return PathfindingTest.Units.Unit

GetNewPreviewPattern() public method

Gets the new current preview pattern (TEMPORARY FUNCTION)
public GetNewPreviewPattern ( Point patternCenterLocation, Point offsettedMouseLocation, int angle ) : UnitGroupPattern
patternCenterLocation Point
offsettedMouseLocation Point The location at which the mouse is at, with offset substracted
angle int The angle
return PathfindingTest.Selection.Patterns.UnitGroupPattern

GetSelectedBuildings() public method

public GetSelectedBuildings ( ) : BuildingSelection
return PathfindingTest.Selection.BuildingSelection

GetSelectedUnits() public method

public GetSelectedUnits ( ) : UnitSelection
return PathfindingTest.Selection.UnitSelection

GetSubstractedOffsettedMouseLocation() public method

Gets the mouse location with the offset substracted.
public GetSubstractedOffsettedMouseLocation ( MouseEvent m ) : Point
m MouseEvent The mouse event.
return Point

GetUnits() public method

public GetUnits ( ) : UnitSelection
return PathfindingTest.Selection.UnitSelection

IsMouseOverFriendlyBuilding() public method

public IsMouseOverFriendlyBuilding ( ) : PathfindingTest.Buildings.Building
return PathfindingTest.Buildings.Building

IsPreviewingBuilding() public method

Whether the player is currently previewing a building
public IsPreviewingBuilding ( ) : System.Boolean
return System.Boolean

OnMouseClick() public method

public OnMouseClick ( MouseEvent m ) : void
m MouseEvent
return void

OnMouseDrag() public method

public OnMouseDrag ( MouseEvent m ) : void
m MouseEvent
return void

OnMouseMotion() public method

public OnMouseMotion ( MouseEvent m ) : void
m MouseEvent
return void

OnMouseRelease() public method

public OnMouseRelease ( MouseEvent m ) : void
m MouseEvent
return void

Player() public method

Player constructor.
public Player ( Alliance alliance, Color color, Point startLocation ) : System
alliance Alliance
color Color
startLocation Point
return System

RemovePreviewBuildings() public method

Removes all the preview buildings
public RemovePreviewBuildings ( ) : void
return void

SpawnStartUnits() public method

Spawns the starting units of this player.
public SpawnStartUnits ( ) : void
return void

Update() public method

Standard Update function.
public Update ( KeyboardState ks, Microsoft.Xna.Framework.Input.MouseState ms ) : void
ks Microsoft.Xna.Framework.Input.KeyboardState
ms Microsoft.Xna.Framework.Input.MouseState
return void

stopUnitSelection() public method

public stopUnitSelection ( ) : void
return void

Property Details

alliance public_oe property

public Alliance alliance
return Alliance

arrowManager public_oe property

public ArrowManager arrowManager
return ArrowManager

color public_oe property

public Color color
return Color

device public_oe property

public GraphicsDevice device
return GraphicsDevice

fastStore public_oe property

public UnitStore fastStore
return UnitStore

lightTexture public_oe property

public Texture2D,Microsoft.Xna.Framework.Graphics lightTexture
return Microsoft.Xna.Framework.Graphics.Texture2D

meleeStore public_oe property

public UnitStore meleeStore
return UnitStore

rangedStore public_oe property

public UnitStore rangedStore
return UnitStore