C# Класс PantheonPrototype.CharacterEntity

The character entity provides the properties and methods used for a character in the game. It inherits the basic traits of an Entity and adds things such as velocity and healing.
Наследование: Entity
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ArmedItem Item
EquippedItems Item>.Dictionary

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

Свойство Тип Описание
angleFacing float
currentArmor int
facing Direction
totalArmor int
velocity Vector2

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

Метод Описание
CharacterEntity ( Vector2 location, Rectangle drawBox, Rectangle boundingBox ) : System

The constuctor... does nothing except call the parent constructor.

Damage ( int damage ) : void

The damage calculation will be in this function.

Draw ( SpriteBatch spriteBatch ) : void

Draw the character class... and override the default behavior... take over the entity. Let none of it survive... except all of it.

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

Loads any assets the entity may or may not need.

Update ( GameTime gameTime, Pantheon gameReference ) : void

Update the character class.

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

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

The constuctor... does nothing except call the parent constructor.
public CharacterEntity ( 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

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

The damage calculation will be in this function.
public Damage ( int damage ) : void
damage int The amount of damage that is being taken
Результат void

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

Draw the character class... and override the default behavior... take over the entity. Let none of it survive... except all of it.
public Draw ( SpriteBatch spriteBatch ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
Результат void

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

Loads any assets the entity may or may not need.
Thrown when the content manager is unable to load the player sprite.
public Load ( Microsoft.Xna.Framework.Content.ContentManager contentManager ) : void
contentManager Microsoft.Xna.Framework.Content.ContentManager The intialized content manager that will be used to load the asset information.
Результат void

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

Update the character class.
public Update ( GameTime gameTime, Pantheon gameReference ) : void
gameTime Microsoft.Xna.Framework.GameTime The game time object for letting you know how old you've gotten since starting the game.
gameReference Pantheon A deeper game reference to the game reference of doom.
Результат void

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

ArmedItem публичное свойство

public Item ArmedItem
Результат Item

EquippedItems публичное свойство

The currently equipped items. Just holds items which are equipped and usable. The character can do things with equipped items. Because they're equipped. If they weren't equipped, the character couldn't use them. I just want to make sure you understand that these are the equipped items. Not the non-equipped ones. If they were not equipped, why would the list be called equipped items? Use your brain. It's not that hard to figure out. Why would anyone need a comment like this to help them understand what an equiped item is? Go... eat a hamburger... and realize it was actually a tortoise... or something equally demeaning. Also, the string refers to which slot the equipment is located. Any child classes should decide which slots are valid. Possibly consider adding a convention so that the item may be accessed outside the character.
public Dictionary EquippedItems
Результат Item>.Dictionary

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

This is the angle (in radians) that the character should be looking at.
protected float angleFacing
Результат float

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

The current armor of the character.
protected int currentArmor
Результат int

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

The direction in which the character is facing.
protected Direction facing
Результат Direction

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

The total armor of the character.
protected int totalArmor
Результат int

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

The velocity of the character.
protected Vector2 velocity
Результат Vector2