C# 클래스 GameEngine.GameObjects.Entity

An abstract Entity class that should be inherited by objects which are to be visible within the game world. Any map objects, NPCs, particles or playable characters should inherit from this class in order to be used by the game engine.
상속: ILoadable
파일 보기 프로젝트 열기: MichaelAquilina/Some-2D-RPG 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Pos Vector2

Private Properties

프로퍼티 타입 설명
Construct void

공개 메소드들

메소드 설명
Entity ( ) : System
Entity ( float x, float y, float scaleX = 1, float scaleY = 1, bool visible = true ) : System
GetDebugInfo ( ) : string

Overridable method whose result is used to display entity debug information by the TeeEngine in its draw method when 'ShowEntityDebugInfo' is set to true in the DrawingOptions. By Default, the result of this method will be the same as the ToString method.

GetPxBoundingBox ( GameTime gameTime ) : Rectangle

Gets the bounding box for this entity at the specified GameTime and using the specified Tile Width and Height (In Pixels). The result of this method will be returned in pixel units and will change from one GameTime instance to another depending on the contents of the entities Drawables. If no drawables are found in the entity, then a rectangle with 0 width and 0 height will be returned.

GetPxBoundingBox ( GameTime gameTime, string group ) : Rectangle

Gets the bounding box for this entity at the specified GameTime and using the specified Tile Width and Height (In Pixels). The result of this method will be returned in pixel units and will change from one GameTime instance to another depending on the contents of the entities Drawables. If no drawables are found in the entity, then a rectangle with 0 width and 0 height will be returned. An optional group parameter may be passed to only calculate the bounding area for a specific group of drawable objects. Passing null to group will test for all groups.

IntersectsWith ( Entity entity1, string entity1Group, Entity entity2, string entity2Group, GameTime gameTime ) : bool

Helper method that wraps the static IntersectsWith Entity method. Assumes the state to check is the current drawable state.

IntersectsWith ( Entity entity1, string entity1State, string entity1Group, Entity entity2, string entity2State, string entity2Group, GameTime gameTime ) : bool

Checks if Two Entities are intersecting each other assuming the specified states, gameTime and group filter. This check is actually rather ineffecient. O(n^2) time complexity. In reality though, we would be smart about what to compare - hence the group and state filters. The number of comparasins between drawables should be kept to a minimum in order to maintain performance.

IntersectsWith ( Entity entity, string entityState, string entityGroup, FRectangle bounds, GameTime gameTime ) : bool
LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
PostCreate ( GameTime gameTime, TeeEngine engine ) : void

Called AFTER the entity is added to the engines entity list. The entity will be garuanteed to have a valid CurrentBoundingBox value and have a place in the QuadTree.

PostDestroy ( GameTime gameTime, TeeEngine engine ) : void

Called AFTER the entity has been removed from the engines entity list.

PreCreate ( GameTime gameTime, TeeEngine engine ) : bool

Called BEFORE the entity is added to the engines entity list. The result of the PreCreate method determines if the entity will be added or not.

PreDestroy ( GameTime gameTime, TeeEngine engine ) : bool

Called BEFORE the entity has been removed from the engines entity list. The result of the PreDestroy method determines if the entity will be removed or not.

ToString ( ) : string
Update ( GameTime gameTime, TeeEngine engine ) : void

비공개 메소드들

메소드 설명
Construct ( float x, float y, float scaleX, float scaleY, bool visible ) : void

메소드 상세

Entity() 공개 메소드

public Entity ( ) : System
리턴 System

Entity() 공개 메소드

public Entity ( float x, float y, float scaleX = 1, float scaleY = 1, bool visible = true ) : System
x float
y float
scaleX float
scaleY float
visible bool
리턴 System

GetDebugInfo() 공개 메소드

Overridable method whose result is used to display entity debug information by the TeeEngine in its draw method when 'ShowEntityDebugInfo' is set to true in the DrawingOptions. By Default, the result of this method will be the same as the ToString method.
public GetDebugInfo ( ) : string
리턴 string

GetPxBoundingBox() 공개 메소드

Gets the bounding box for this entity at the specified GameTime and using the specified Tile Width and Height (In Pixels). The result of this method will be returned in pixel units and will change from one GameTime instance to another depending on the contents of the entities Drawables. If no drawables are found in the entity, then a rectangle with 0 width and 0 height will be returned.
public GetPxBoundingBox ( GameTime gameTime ) : Rectangle
gameTime Microsoft.Xna.Framework.GameTime
리턴 Microsoft.Xna.Framework.Rectangle

GetPxBoundingBox() 공개 메소드

Gets the bounding box for this entity at the specified GameTime and using the specified Tile Width and Height (In Pixels). The result of this method will be returned in pixel units and will change from one GameTime instance to another depending on the contents of the entities Drawables. If no drawables are found in the entity, then a rectangle with 0 width and 0 height will be returned. An optional group parameter may be passed to only calculate the bounding area for a specific group of drawable objects. Passing null to group will test for all groups.
public GetPxBoundingBox ( GameTime gameTime, string group ) : Rectangle
gameTime Microsoft.Xna.Framework.GameTime The Current GameTime.
group string Optional string value that specifies the groups to include in BB calculations.
리턴 Microsoft.Xna.Framework.Rectangle

IntersectsWith() 공개 정적인 메소드

Helper method that wraps the static IntersectsWith Entity method. Assumes the state to check is the current drawable state.
public static IntersectsWith ( Entity entity1, string entity1Group, Entity entity2, string entity2Group, GameTime gameTime ) : bool
entity1 Entity
entity1Group string
entity2 Entity
entity2Group string
gameTime Microsoft.Xna.Framework.GameTime
리턴 bool

IntersectsWith() 공개 정적인 메소드

Checks if Two Entities are intersecting each other assuming the specified states, gameTime and group filter. This check is actually rather ineffecient. O(n^2) time complexity. In reality though, we would be smart about what to compare - hence the group and state filters. The number of comparasins between drawables should be kept to a minimum in order to maintain performance.
public static IntersectsWith ( Entity entity1, string entity1State, string entity1Group, Entity entity2, string entity2State, string entity2Group, GameTime gameTime ) : bool
entity1 Entity
entity1State string
entity1Group string
entity2 Entity
entity2State string
entity2Group string
gameTime Microsoft.Xna.Framework.GameTime
리턴 bool

IntersectsWith() 공개 정적인 메소드

public static IntersectsWith ( Entity entity, string entityState, string entityGroup, FRectangle bounds, GameTime gameTime ) : bool
entity Entity
entityState string
entityGroup string
bounds GameEngine.Drawing.FRectangle
gameTime Microsoft.Xna.Framework.GameTime
리턴 bool

LoadContent() 공개 메소드

public LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
content Microsoft.Xna.Framework.Content.ContentManager
리턴 void

PostCreate() 공개 메소드

Called AFTER the entity is added to the engines entity list. The entity will be garuanteed to have a valid CurrentBoundingBox value and have a place in the QuadTree.
public PostCreate ( GameTime gameTime, TeeEngine engine ) : void
gameTime Microsoft.Xna.Framework.GameTime
engine TeeEngine
리턴 void

PostDestroy() 공개 메소드

Called AFTER the entity has been removed from the engines entity list.
public PostDestroy ( GameTime gameTime, TeeEngine engine ) : void
gameTime Microsoft.Xna.Framework.GameTime
engine TeeEngine
리턴 void

PreCreate() 공개 메소드

Called BEFORE the entity is added to the engines entity list. The result of the PreCreate method determines if the entity will be added or not.
public PreCreate ( GameTime gameTime, TeeEngine engine ) : bool
gameTime Microsoft.Xna.Framework.GameTime
engine TeeEngine
리턴 bool

PreDestroy() 공개 메소드

Called BEFORE the entity has been removed from the engines entity list. The result of the PreDestroy method determines if the entity will be removed or not.
public PreDestroy ( GameTime gameTime, TeeEngine engine ) : bool
gameTime Microsoft.Xna.Framework.GameTime
engine TeeEngine
리턴 bool

ToString() 공개 메소드

public ToString ( ) : string
리턴 string

Update() 공개 메소드

public Update ( GameTime gameTime, TeeEngine engine ) : void
gameTime Microsoft.Xna.Framework.GameTime
engine TeeEngine
리턴 void

프로퍼티 상세

Pos 공개적으로 프로퍼티

Entities X and Y position on the Map.
public Vector2 Pos
리턴 Vector2