C# 클래스 SGDE.Entity

Base Class representative of any onscreen drawable that appears in a scene
상속: SceneNode, IUpdateable
파일 보기 프로젝트 열기: sgdc/sgdc-old

보호된 프로퍼티들

프로퍼티 타입 설명
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