C# Класс MyGame.BulletsManager

This class represent the bullet manager that manages creating and calling updates on bullets, also removing bullet at collision detected.
Наследование: Microsoft.Xna.Framework.DrawableGameComponent, IEvent
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
events List

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

Метод Описание
AddBullet ( Vector3 position, Vector3 rotation, Vector3 direction ) : void

Add a new bullet at the specified position, rotation and direction

BulletsManager ( MyGame game ) : System

Constructor that initialize the bullet manager

Draw ( GameTime gameTime ) : void

This method renders the current state.

Update ( GameTime gameTime ) : void

Allows the component to run logic.

addEvent ( Event ev ) : void

Add event to the event queue

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

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

Fire a new bullet if the specified event(C_ATTACK_BULLET_END) was received

UpdateShots ( GameTime gameTime ) : void

update the bullet if the bulltet out of range or collide with the monster remove it

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

AddBullet() публичный метод

Add a new bullet at the specified position, rotation and direction
public AddBullet ( Vector3 position, Vector3 rotation, Vector3 direction ) : void
position Vector3 initial position of the new bullet
rotation Vector3 rotation of the new bullet
direction Vector3 Direction in which the bullet will move
Результат void

BulletsManager() публичный метод

Constructor that initialize the bullet manager
public BulletsManager ( MyGame game ) : System
game MyGame Instance of MyGame this game component is attached to
Результат System

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

This method renders the current state.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The elapsed game time.
Результат void

FireShots() защищенный метод

Fire a new bullet if the specified event(C_ATTACK_BULLET_END) was received
protected FireShots ( ) : void
Результат void

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

Allows the component to run logic.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The gametime.
Результат void

UpdateShots() защищенный метод

update the bullet if the bulltet out of range or collide with the monster remove it
protected UpdateShots ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The game time
Результат void

addEvent() публичный метод

Add event to the event queue
public addEvent ( Event ev ) : void
ev Event Event to be added
Результат void

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

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

protected List events
Результат List