C# 클래스 PathfindingTest.Units.Unit

상속: OnCollisionChangedListener, Aggroable, Damageable
파일 보기 프로젝트 열기: Wotuu/RTS_XNA_v2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
isDead System.Boolean

Private Properties

프로퍼티 타입 설명
Draw void
DrawHealthBar void
Move void
SetMoveToTarget void
isTargetDead System.Boolean
isUnitDead System.Boolean

공개 메소드들

메소드 설명
AttackBuilding ( Building enemyBuilding ) : void
AttackUnit ( Unit unitToAttack ) : void

Sets the target to attack

CalculatePath ( Point p ) : CustomArrayList

Calculates a path between the current unit and the point.

CheckCollision ( ) : void

Repels other units that dare come close to our unit!

CheckForBuildingsInRange ( float rangeToCheck ) : void

Updates the buildingsInRange variable, to contain all the buildings within the attack range of this unit.

CheckForEnemiesInRange ( float rangeToCheck ) : void

Updates the enemiesInRange variable, to contain all the enemies within the attack range of this unit.

Defend ( Unit unitToDefend ) : void

Sets the target to defend

DefineDrawRectangle ( ) : Rectangle

Defines the rectangle/hitbox for the Unit. With draw offset

DefineRectangle ( ) : Rectangle

Defines the rectangle/hitbox for the Unit. without draw offset

Dispose ( ) : void

Dispose of this unit.

GetCost ( Type t ) : int

Gets the cost of a unit

GetDrawRectangle ( ) : Rectangle

Gets the draw rectangle of this unit.

GetLocation ( ) : Point

Gets a point location of this unit

MoveToNow ( Point p ) : void

Feel free to use "\ <(*^_^*)> /"

MoveToQueue ( Point p ) : void

Moves to a point in a while, by placing this unit and the point in a queue. When the time is there, process the pathfind This method is preferred to MoveToNow(Point p), as it doesn't cause a performance peek, but it may take a few frames before your path is ready.

OnAggro ( AggroEvent e ) : void
OnAggroRecieved ( AggroEvent e ) : void
OnCollisionChangedListener ( CollisionChangedEvent collisionEvent ) : void
OnDamage ( DamageEvent e ) : void
SetAssaultLocation ( Point assaultPoint ) : void
SetJob ( Unit newJob ) : void

Set's the new Job for the unit

Swing ( Damageable target ) : void

This unit will attempt to fire/swing/kill/cast!

TryToSwing ( ) : void
Unit ( Player p, int x, int y, float movementSpeed, float attackRange, float aggroRange, float rateOfFire ) : System
Update ( KeyboardState ks, Microsoft.Xna.Framework.Input.MouseState ms ) : void
UpdateAttack ( ) : void
UpdateDefense ( ) : void

보호된 메소드들

메소드 설명
UpdateMovement ( ) : void

Updates the movement of this unit.

비공개 메소드들

메소드 설명
Draw ( SpriteBatch sb ) : void
DrawHealthBar ( SpriteBatch sb ) : void
Move ( ) : void

Updates the drawing position of this Unit.

SetMoveToTarget ( int x, int y ) : void

Set the point this Unit has to move to. direction != direction is used for checking NaNExceptions.

isTargetDead ( ) : System.Boolean

Checks to see wether the set target has died yet.

isUnitDead ( Unit unit ) : System.Boolean

메소드 상세

AttackBuilding() 공개 메소드

public AttackBuilding ( Building enemyBuilding ) : void
enemyBuilding Building
리턴 void

AttackUnit() 공개 메소드

Sets the target to attack
public AttackUnit ( Unit unitToAttack ) : void
unitToAttack Unit
리턴 void

CalculatePath() 공개 메소드

Calculates a path between the current unit and the point.
public CalculatePath ( Point p ) : CustomArrayList
p Point The point to calculate to.
리턴 CustomArrayList

CheckCollision() 공개 메소드

Repels other units that dare come close to our unit!
public CheckCollision ( ) : void
리턴 void

CheckForBuildingsInRange() 공개 메소드

Updates the buildingsInRange variable, to contain all the buildings within the attack range of this unit.
public CheckForBuildingsInRange ( float rangeToCheck ) : void
rangeToCheck float
리턴 void

CheckForEnemiesInRange() 공개 메소드

Updates the enemiesInRange variable, to contain all the enemies within the attack range of this unit.
public CheckForEnemiesInRange ( float rangeToCheck ) : void
rangeToCheck float
리턴 void

Defend() 공개 메소드

Sets the target to defend
public Defend ( Unit unitToDefend ) : void
unitToDefend Unit
리턴 void

DefineDrawRectangle() 공개 메소드

Defines the rectangle/hitbox for the Unit. With draw offset
public DefineDrawRectangle ( ) : Rectangle
리턴 Microsoft.Xna.Framework.Rectangle

DefineRectangle() 공개 메소드

Defines the rectangle/hitbox for the Unit. without draw offset
public DefineRectangle ( ) : Rectangle
리턴 Microsoft.Xna.Framework.Rectangle

Dispose() 공개 메소드

Dispose of this unit.
public Dispose ( ) : void
리턴 void

GetCost() 공개 정적인 메소드

Gets the cost of a unit
public static GetCost ( Type t ) : int
t System.Type The unit type of which the cost is wanted
리턴 int

GetDrawRectangle() 공개 메소드

Gets the draw rectangle of this unit.
public GetDrawRectangle ( ) : Rectangle
리턴 Microsoft.Xna.Framework.Rectangle

GetLocation() 공개 메소드

Gets a point location of this unit
public GetLocation ( ) : Point
리턴 Point

MoveToNow() 공개 메소드

Feel free to use "\ <(*^_^*)> /"
public MoveToNow ( Point p ) : void
p Point The point to move to
리턴 void

MoveToQueue() 공개 메소드

Moves to a point in a while, by placing this unit and the point in a queue. When the time is there, process the pathfind This method is preferred to MoveToNow(Point p), as it doesn't cause a performance peek, but it may take a few frames before your path is ready.
public MoveToQueue ( Point p ) : void
p Point The point to move to, in a few frames depending on the queue
리턴 void

OnAggro() 공개 추상적인 메소드

public abstract OnAggro ( AggroEvent e ) : void
e PathfindingTest.Combat.AggroEvent
리턴 void

OnAggroRecieved() 공개 추상적인 메소드

public abstract OnAggroRecieved ( AggroEvent e ) : void
e PathfindingTest.Combat.AggroEvent
리턴 void

OnCollisionChangedListener() 공개 메소드

public OnCollisionChangedListener ( CollisionChangedEvent collisionEvent ) : void
collisionEvent AStarCollisionMap.Collision.CollisionChangedEvent
리턴 void

OnDamage() 공개 메소드

public OnDamage ( DamageEvent e ) : void
e PathfindingTest.Combat.DamageEvent
리턴 void

SetAssaultLocation() 공개 메소드

public SetAssaultLocation ( Point assaultPoint ) : void
assaultPoint Point
리턴 void

SetJob() 공개 메소드

Set's the new Job for the unit
public SetJob ( Unit newJob ) : void
newJob Unit
리턴 void

Swing() 공개 추상적인 메소드

This unit will attempt to fire/swing/kill/cast!
public abstract Swing ( Damageable target ) : void
target Damageable
리턴 void

TryToSwing() 공개 메소드

public TryToSwing ( ) : void
리턴 void

Unit() 공개 메소드

public Unit ( Player p, int x, int y, float movementSpeed, float attackRange, float aggroRange, float rateOfFire ) : System
p PathfindingTest.Players.Player
x int
y int
movementSpeed float
attackRange float
aggroRange float
rateOfFire float
리턴 System

Update() 공개 추상적인 메소드

public abstract Update ( KeyboardState ks, Microsoft.Xna.Framework.Input.MouseState ms ) : void
ks Microsoft.Xna.Framework.Input.KeyboardState
ms Microsoft.Xna.Framework.Input.MouseState
리턴 void

UpdateAttack() 공개 메소드

public UpdateAttack ( ) : void
리턴 void

UpdateDefense() 공개 메소드

public UpdateDefense ( ) : void
리턴 void

UpdateMovement() 보호된 메소드

Updates the movement of this unit.
protected UpdateMovement ( ) : void
리턴 void

프로퍼티 상세

isDead 공개적으로 프로퍼티

public Boolean,System isDead
리턴 System.Boolean