C# Класс SGDE.Entity

Base Class representative of any onscreen drawable that appears in a scene
Наследование: SceneNode, IUpdateable
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
id uint
image Sprite
mCollisionUnit SGDE.Physics.Collision.CollisionUnit
mPhysBaby SGDE.Physics.PhysicsBaby

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
SetUpCollision ( ) : void

Set up the collision unit for this Entity.

Приватные методы

Метод Описание
InSetUpCollision ( ) : void
SetColor ( Color backColor ) : void

Описание методов

CollisionChange() публичный Метод

Collision change event. This is usually called when an Entitiy collides with this Entity.
public CollisionChange ( ) : void
Результат void

CompareID() публичный Метод

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.
Результат bool

CopyTo() публичный Метод

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.
Результат void

Draw() публичный Метод

Draws the entity to the screen
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Результат void

EnablePhysics() публичный Метод

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.
Результат void

Entity() публичный Метод

public Entity ( ) : System
Результат System

Entity() публичный Метод

Constructs a new entity in the scene
public Entity ( Vector2 position ) : System
position Vector2 Coordinates
Результат System

Entity() публичный Метод

Constructs a new entity in the scene
public Entity ( float x, float y ) : System
x float X coordinate
y float Y coordinate
Результат System

GetCollisionUnit() публичный Метод

Get the collision unit for this Entity
public GetCollisionUnit ( ) : CollisionUnit
Результат SGDE.Physics.Collision.CollisionUnit

GetID() публичный Метод

Get the ID of this Entity.
public GetID ( ) : uint
Результат uint

GetPhysicsBaby() публичный Метод

Get the PhysicsBaby for this Entity.
public GetPhysicsBaby ( ) : PhysicsBaby
Результат SGDE.Physics.PhysicsBaby

GetVelocity() публичный Метод

Get this Entity's velocity. This is a helper function that is equivilant to GetPhysicsBaby().GetVelocity();.
public GetVelocity ( ) : Vector2
Результат Vector2

SetCollisionUnit() публичный Метод

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.
Результат void

SetUpCollision() защищенный Метод

Set up the collision unit for this Entity.
protected SetUpCollision ( ) : void
Результат void

SetVelocity() публичный Метод

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.
Результат void

SetVelocity() публичный Метод

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.
Результат void

Update() публичный Метод

Called once during each step taken by the engine
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The current game time
Результат void

Описание свойств

id защищенное свойство

ID for Checking the type of an Entity
protected uint id
Результат uint

image защищенное свойство

Sprite which is drawn to represent the entity
protected Sprite image
Результат Sprite

mCollisionUnit защищенное свойство

Contains the collision logic for the entity
protected CollisionUnit,SGDE.Physics.Collision mCollisionUnit
Результат SGDE.Physics.Collision.CollisionUnit

mPhysBaby защищенное свойство

Contains the general collision data for the entity.
protected PhysicsBaby,SGDE.Physics mPhysBaby
Результат SGDE.Physics.PhysicsBaby