C# Класс Swordening.Wizard

Наследование: Hero
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Cast1 ( GameTime gameTime ) : bool

checks if hero has enough mana to cast a fireball and if so then plays the sound and adds a fireball projectile.

RegenerateMana ( float amount = -1 ) : void

Regenerates mana.

Update ( GameTime gameTime ) : void

Allows the game component to update itself.

Wizard ( SwordeningGame game, InGame gameState, Vector3 position ) : System
checkDeath ( ) : void

Checks if hero has been slain and removes it from the game components.

increaseStats ( ) : void

When a level is gained hitpoints and and mana is increased. If hero dies at the same time when he gains a level, hero does not get max hitpoints back. The dead should stay dead.

killGain ( int exp, int money ) : void

this method is called whenever a monster dies. The hero gains exp and gold from the monster that died and calls for levelup method.

levelup ( ) : void

Checks if the hero has gained enough experience to gain a lvl and if so multiplies to next level by 2 so that the next level won't be reached as fast as the previous and also calls for increaseStats() method.

takeDmg ( int amount ) : void

Reduces hitpoints as given in the parametres. Calls checkDeath() after this.

Защищенные методы

Метод Описание
LoadContent ( ) : void

Allows the game comopnent to load content from disk.

ProcessKeyboardInput ( GameTime gameTime ) : void

Reads and processes the input from the keyboard.

ProcessMouseInput ( GameTime gameTime ) : void

Reads and processes the input from the mouse.

Приватные методы

Метод Описание
addProjectile ( ) : void

the direction of the fireball is taken from the mouse position in other words the projectile is launched towards the current mouse position

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

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

checks if hero has enough mana to cast a fireball and if so then plays the sound and adds a fireball projectile.
public Cast1 ( GameTime gameTime ) : bool
gameTime Microsoft.Xna.Framework.GameTime
Результат bool

LoadContent() защищенный Метод

Allows the game comopnent to load content from disk.
protected LoadContent ( ) : void
Результат void

ProcessKeyboardInput() защищенный Метод

Reads and processes the input from the keyboard.
protected ProcessKeyboardInput ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Результат void

ProcessMouseInput() защищенный Метод

Reads and processes the input from the mouse.
protected ProcessMouseInput ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Результат void

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

Regenerates mana.
public RegenerateMana ( float amount = -1 ) : void
amount float
Результат void

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

Allows the game component to update itself.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Provides a snapshot of timing values.
Результат void

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

public Wizard ( SwordeningGame game, InGame gameState, Vector3 position ) : System
game SwordeningGame
gameState InGame
position Vector3
Результат System

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

Checks if hero has been slain and removes it from the game components.
public checkDeath ( ) : void
Результат void

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

When a level is gained hitpoints and and mana is increased. If hero dies at the same time when he gains a level, hero does not get max hitpoints back. The dead should stay dead.
public increaseStats ( ) : void
Результат void

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

this method is called whenever a monster dies. The hero gains exp and gold from the monster that died and calls for levelup method.
public killGain ( int exp, int money ) : void
exp int
money int
Результат void

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

Checks if the hero has gained enough experience to gain a lvl and if so multiplies to next level by 2 so that the next level won't be reached as fast as the previous and also calls for increaseStats() method.
public levelup ( ) : void
Результат void

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

Reduces hitpoints as given in the parametres. Calls checkDeath() after this.
public takeDmg ( int amount ) : void
amount int
Результат void