C# Class SGDE.Entity

Base Class representative of any onscreen drawable that appears in a scene
Inheritance: SceneNode, IUpdateable
Afficher le fichier Open project: sgdc/sgdc-old

Protected Properties

Свойство Type Description
id uint
image Sprite
mCollisionUnit SGDE.Physics.Collision.CollisionUnit
mPhysBaby SGDE.Physics.PhysicsBaby

Méthodes publiques

Méthode Description
CollisionChange ( ) : void

Collision change event. This is usually called when an Entitiy collides with this Entity.

CompareID ( Entity e ) : bool

Compare this ID's Entity with another Entity to determine if they are the same.

CopyTo ( Entity &ent ) : void

Copy this Entity to another entity. If overriden then the base.CopyTo call must be the first line of code.

Draw ( GameTime gameTime ) : void

Draws the entity to the screen

EnablePhysics ( bool bPhysics, bool bCollision ) : void

Enable physics on this Entity.

Entity ( ) : System
Entity ( Vector2 position ) : System

Constructs a new entity in the scene

Entity ( float x, float y ) : System

Constructs a new entity in the scene

GetCollisionUnit ( ) : CollisionUnit

Get the collision unit for this Entity

GetID ( ) : uint

Get the ID of this Entity.

GetPhysicsBaby ( ) : PhysicsBaby

Get the PhysicsBaby for this Entity.

GetVelocity ( ) : Vector2

Get this Entity's velocity. This is a helper function that is equivilant to GetPhysicsBaby().GetVelocity();.

SetCollisionUnit ( CollisionUnit unit ) : void

Set the collision unit for this Entity.

SetVelocity ( Vector2 velocity ) : void

Set this Entity's velocity. This is a helper function that is equivilant to GetPhysicsBaby().SetVelocity(velocity);.

SetVelocity ( float x, float y ) : void

Set this Entity's velocity. This is a helper function that is equivilant to SetVelocity(new Vector2(x, y));.

Update ( GameTime gameTime ) : void

Called once during each step taken by the engine

Méthodes protégées

Méthode Description
SetUpCollision ( ) : void

Set up the collision unit for this Entity.

Private Methods

Méthode Description
InSetUpCollision ( ) : void
SetColor ( Color backColor ) : void

Method Details

CollisionChange() public méthode

Collision change event. This is usually called when an Entitiy collides with this Entity.
public CollisionChange ( ) : void
Résultat void

CompareID() public méthode

Compare this ID's Entity with another Entity to determine if they are the same.
public CompareID ( Entity e ) : bool
e Entity The other Entity to compare IDs with.
Résultat bool

CopyTo() public méthode

Copy this Entity to another entity. If overriden then the base.CopyTo call must be the first line of code.
public CopyTo ( Entity &ent ) : void
ent Entity The entity to copy to.
Résultat void

Draw() public méthode

Draws the entity to the screen
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

EnablePhysics() public méthode

Enable physics on this Entity.
public EnablePhysics ( bool bPhysics, bool bCollision ) : void
bPhysics bool true if physics should be enabled for this Entity, false if it should be disabled.
bCollision bool true collisions should be enabled for this Entity, false if it should be disabled.
Résultat void

Entity() public méthode

public Entity ( ) : System
Résultat System

Entity() public méthode

Constructs a new entity in the scene
public Entity ( Vector2 position ) : System
position Vector2 Coordinates
Résultat System

Entity() public méthode

Constructs a new entity in the scene
public Entity ( float x, float y ) : System
x float X coordinate
y float Y coordinate
Résultat System

GetCollisionUnit() public méthode

Get the collision unit for this Entity
public GetCollisionUnit ( ) : CollisionUnit
Résultat SGDE.Physics.Collision.CollisionUnit

GetID() public méthode

Get the ID of this Entity.
public GetID ( ) : uint
Résultat uint

GetPhysicsBaby() public méthode

Get the PhysicsBaby for this Entity.
public GetPhysicsBaby ( ) : PhysicsBaby
Résultat SGDE.Physics.PhysicsBaby

GetVelocity() public méthode

Get this Entity's velocity. This is a helper function that is equivilant to GetPhysicsBaby().GetVelocity();.
public GetVelocity ( ) : Vector2
Résultat Vector2

SetCollisionUnit() public méthode

Set the collision unit for this Entity.
public SetCollisionUnit ( CollisionUnit unit ) : void
unit SGDE.Physics.Collision.CollisionUnit The collision unit to set for this Entity.
Résultat void

SetUpCollision() protected méthode

Set up the collision unit for this Entity.
protected SetUpCollision ( ) : void
Résultat void

SetVelocity() public méthode

Set this Entity's velocity. This is a helper function that is equivilant to GetPhysicsBaby().SetVelocity(velocity);.
public SetVelocity ( Vector2 velocity ) : void
velocity Vector2 The velocity to set this Entity's velocity to.
Résultat void

SetVelocity() public méthode

Set this Entity's velocity. This is a helper function that is equivilant to SetVelocity(new Vector2(x, y));.
public SetVelocity ( float x, float y ) : void
x float The horizontal velocity of for this Entity.
y float The veritcal velocity of for this Entity.
Résultat void

Update() public méthode

Called once during each step taken by the engine
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The current game time
Résultat void

Property Details

id protected_oe property

ID for Checking the type of an Entity
protected uint id
Résultat uint

image protected_oe property

Sprite which is drawn to represent the entity
protected Sprite image
Résultat Sprite

mCollisionUnit protected_oe property

Contains the collision logic for the entity
protected CollisionUnit,SGDE.Physics.Collision mCollisionUnit
Résultat SGDE.Physics.Collision.CollisionUnit

mPhysBaby protected_oe property

Contains the general collision data for the entity.
protected PhysicsBaby,SGDE.Physics mPhysBaby
Résultat SGDE.Physics.PhysicsBaby