C# Class 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.
Inheritance: Entity
Exibir arquivo Open project: Bacon41/PantheonPrototype Class Usage Examples

Public Properties

Property Type Description
ArmedItem Item
EquippedItems Item>.Dictionary

Protected Properties

Property Type Description
angleFacing float
currentArmor int
facing Direction
totalArmor int
velocity Vector2

Public Methods

Method Description
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.

Method Details

CharacterEntity() public method

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.
return System

Damage() public method

The damage calculation will be in this function.
public Damage ( int damage ) : void
damage int The amount of damage that is being taken
return void

Draw() public method

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
return void

Load() public method

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.
return void

Update() public method

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.
return void

Property Details

ArmedItem public_oe property

public Item ArmedItem
return Item

EquippedItems public_oe property

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
return Item>.Dictionary

angleFacing protected_oe property

This is the angle (in radians) that the character should be looking at.
protected float angleFacing
return float

currentArmor protected_oe property

The current armor of the character.
protected int currentArmor
return int

facing protected_oe property

The direction in which the character is facing.
protected Direction facing
return Direction

totalArmor protected_oe property

The total armor of the character.
protected int totalArmor
return int

velocity protected_oe property

The velocity of the character.
protected Vector2 velocity
return Vector2