C# Class Project2.GameObjects.Boids.Boid

Inheritance: Project2.GameObjects.Abstract.ModelPhysicsObject
ファイルを表示 Open project: nuclearpidgeon/graphicsproj2

Public Properties

Property Type Description
attack double
boidType Flock.BoidType
flock Flock
health double
maxHealth double

Protected Properties

Property Type Description
ToDestroy System.Boolean
healthyColor Color
sickColor Color

Public Methods

Method Description
Boid ( Project2Game game, Flock flock, SharpDX.Toolkit.Graphics.Model model, System.Vector3 position, Flock boidType ) : System
Destroy ( System.Boolean Async = false ) : void

Implements object destroying in a manner that can be called asynchronously The first call to this function doesn't actually destroy the object, but sets a flag to destroy it. Calling this function again will remove the object. A suggested use case it to call this function if ToDestroy is inside Update()

Draw ( SharpDX.Toolkit.GameTime gametime ) : void
HandleCollision ( RigidBody body1, RigidBody body2, Jitter.LinearMath.JVector point1, Jitter.LinearMath.JVector point2, Jitter.LinearMath.JVector normal, float penetration ) : void

This method handles explicit object collision logic. Is registered to physics engine CollisionDetected event handler. Fired on any detected collision, so must check if the collision applies to this object

Update ( SharpDX.Toolkit.GameTime gametime ) : void

Protected Methods

Method Description
Collision ( RigidBody other ) : void

Method Details

Boid() public method

public Boid ( Project2Game game, Flock flock, SharpDX.Toolkit.Graphics.Model model, System.Vector3 position, Flock boidType ) : System
game Project2Game
flock Flock
model SharpDX.Toolkit.Graphics.Model
position System.Vector3
boidType Flock
return System

Collision() protected method

protected Collision ( RigidBody other ) : void
other RigidBody
return void

Destroy() public method

Implements object destroying in a manner that can be called asynchronously The first call to this function doesn't actually destroy the object, but sets a flag to destroy it. Calling this function again will remove the object. A suggested use case it to call this function if ToDestroy is inside Update()
public Destroy ( System.Boolean Async = false ) : void
Async System.Boolean
return void

Draw() public method

public Draw ( SharpDX.Toolkit.GameTime gametime ) : void
gametime SharpDX.Toolkit.GameTime
return void

HandleCollision() public method

This method handles explicit object collision logic. Is registered to physics engine CollisionDetected event handler. Fired on any detected collision, so must check if the collision applies to this object
public HandleCollision ( RigidBody body1, RigidBody body2, Jitter.LinearMath.JVector point1, Jitter.LinearMath.JVector point2, Jitter.LinearMath.JVector normal, float penetration ) : void
body1 RigidBody
body2 RigidBody
point1 Jitter.LinearMath.JVector
point2 Jitter.LinearMath.JVector
normal Jitter.LinearMath.JVector
penetration float
return void

Update() public method

public Update ( SharpDX.Toolkit.GameTime gametime ) : void
gametime SharpDX.Toolkit.GameTime
return void

Property Details

ToDestroy protected_oe property

protected Boolean,System ToDestroy
return System.Boolean

attack public_oe property

public double attack
return double

boidType public_oe property

public Flock.BoidType boidType
return Flock.BoidType

flock public_oe property

public Flock flock
return Flock

health public_oe property

public double health
return double

healthyColor protected_oe property

protected Color healthyColor
return Color

maxHealth public_oe property

public double maxHealth
return double

sickColor protected_oe property

protected Color sickColor
return Color