C# Класс PantheonPrototype.Entity

The Entity defines an object within the game. It has physical presence in the game as a Sprite and can collide with other Entities.
Показать файл Открыть проект

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

Свойство Тип Описание
actionPoint Vector2
boundingBox Microsoft.Xna.Framework.Rectangle
characteristics List
currentState string
drawingBox Microsoft.Xna.Framework.Rectangle
prevLocation Vector2
sprite Sprite
toDestroy bool

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

Метод Описание
Draw ( SpriteBatch canvas ) : void

Draws the entity to its current location.

Entity ( ) : System

A no parameter entity for conveniences sake.

Entity ( Vector2 location, Rectangle drawBox, Rectangle boundingBox ) : System

Constructs a basic entity. This is a more accessible constructor. In general, use this constructor when making new entities.

Entity ( float x, float y, Rectangle drawBox, Rectangle boundingBox ) : System

Constructs a basic entity. This is the technical constructor. Unless you understand exactly how the entity is stored, I recommend using the other constructor.

Load ( Microsoft.Xna.Framework.Content.ContentManager contentManager ) : void

Loads any assets this particular entity needs.

Update ( GameTime gameTime, Pantheon gameReference ) : void

Updates the entity... yeah.

collidesWith ( Entity other ) : bool

Detects collisions between another entity. Uses the rectangle defining sprite to detect collisions.

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

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

Draws the entity to its current location.
public Draw ( SpriteBatch canvas ) : void
canvas Microsoft.Xna.Framework.Graphics.SpriteBatch An initialized sprite batch to draw the sprite upon.
Результат void

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

A no parameter entity for conveniences sake.
public Entity ( ) : System
Результат System

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

Constructs a basic entity. This is a more accessible constructor. In general, use this constructor when making new entities.
public Entity ( Vector2 location, Rectangle drawBox, Rectangle boundingBox ) : System
location Vector2 The location of the entity relative to global space. Note that the reference point of the entity is the center of the bounding box.
drawBox Microsoft.Xna.Framework.Rectangle The box to which the sprite will be drawn. Only the width and height will be used.
boundingBox Microsoft.Xna.Framework.Rectangle The bounding box of the entity relative to the upper right hand corner of the entity.
Результат System

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

Constructs a basic entity. This is the technical constructor. Unless you understand exactly how the entity is stored, I recommend using the other constructor.
public Entity ( float x, float y, Rectangle drawBox, Rectangle boundingBox ) : System
x float The x coordinate of the action point.
y float The y coordinate of the action point.
drawBox Microsoft.Xna.Framework.Rectangle The draw box defines the area to which the sprite /// is drawn relative to the upper left hand corner..
boundingBox Microsoft.Xna.Framework.Rectangle The bounding box relative to the action point.
Результат System

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

Loads any assets this particular entity needs.
public Load ( Microsoft.Xna.Framework.Content.ContentManager contentManager ) : void
contentManager Microsoft.Xna.Framework.Content.ContentManager
Результат void

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

Updates the entity... yeah.
public Update ( GameTime gameTime, Pantheon gameReference ) : void
gameTime Microsoft.Xna.Framework.GameTime Even has the option for frame rate, pretty cool eh?
gameReference Pantheon The ugly global game reference of doom.
Результат void

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

Detects collisions between another entity. Uses the rectangle defining sprite to detect collisions.
public collidesWith ( Entity other ) : bool
other Entity The entity to detect collision with.
Результат bool

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

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

This is the point around which the sprite is drawn. It functions as the center of the entity and is automatically set to the center of the bounding box.
protected Vector2 actionPoint
Результат Vector2

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

Puppies!!! No puppies, actually fruit. Also, this is the bounding box.
protected Rectangle,Microsoft.Xna.Framework boundingBox
Результат Microsoft.Xna.Framework.Rectangle

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

A list of characteristics which determine what an entity does on collision. Basically, this is a list that determines which collision types to check.
protected List characteristics
Результат List

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

A string representing the current state.
protected string currentState
Результат string

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

The box to which the sprite will be drawn.
protected Rectangle,Microsoft.Xna.Framework drawingBox
Результат Microsoft.Xna.Framework.Rectangle

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

protected Vector2 prevLocation
Результат Vector2

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

The visual representation of the entity.
protected Sprite sprite
Результат Sprite

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

This tells the level that it is dead, and needs to be removed.
protected bool toDestroy
Результат bool