C# Класс PantheonPrototype.Weapon

A basic implementation of a weapon inheriting from Item. As more weapons are added, the specific logic of the weapon should be moved to a subclass and this should be a parent of all weapons.
Наследование: Item
Показать файл Открыть проект

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

Свойство Тип Описание
bulletType String
currentAmmo int
damage int
fireRate float
offset double
range int
reloadDelay System.TimeSpan
reloading bool
speed int
totalAmmo int

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

Метод Описание
PercentToEndReload ( ) : float
Reload ( GameTime gameTime ) : void

The method to start the reloading procudure.

Update ( GameTime gameTime, Pantheon gameReference ) : void

Updates the weapon, taking care for cooldown and other time sensitive functions.

Weapon ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System

Initializes key values of a weapon.

activate ( Pantheon gameReference, CharacterEntity holder ) : void

Shoot the weapon. That's what this game is really about, right? Also, we need to rethink the way that shooting works right now. Eventually, I think that the Character Entity class needs an aiming point. This makes it so both Enemies and Players can use weapons.

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

Метод Описание
shootABullet ( Pantheon gameReference, CharacterEntity holder ) : void

Shoots a bullet.

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

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

public PercentToEndReload ( ) : float
Результат float

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

The method to start the reloading procudure.
public Reload ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Time since last call.
Результат void

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

Updates the weapon, taking care for cooldown and other time sensitive functions.
public Update ( GameTime gameTime, Pantheon gameReference ) : void
gameTime Microsoft.Xna.Framework.GameTime The current game time.
gameReference Pantheon A reference to the entire game.
Результат void

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

Initializes key values of a weapon.
public Weapon ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System
texture Microsoft.Xna.Framework.Graphics.Texture2D
Результат System

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

Shoot the weapon. That's what this game is really about, right? Also, we need to rethink the way that shooting works right now. Eventually, I think that the Character Entity class needs an aiming point. This makes it so both Enemies and Players can use weapons.
public activate ( Pantheon gameReference, CharacterEntity holder ) : void
gameReference Pantheon A reference so we can see where everything is.
holder CharacterEntity A reference to the character holding the weapon.
Результат void

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

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

protected String bulletType
Результат String

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

The current amount of ammunition available to the player.
protected int currentAmmo
Результат int

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

protected int damage
Результат int

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

The rate of fire of the gun as the number of shots per second.
protected float fireRate
Результат float

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

This is hacky but it works... and it's due tomorrow; So ya.
protected double offset
Результат double

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

The distance that the bullet can travel.
protected int range
Результат int

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

protected TimeSpan,System reloadDelay
Результат System.TimeSpan

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

protected bool reloading
Результат bool

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

protected int speed
Результат int

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

The total amount of ammunition available to the player.
protected int totalAmmo
Результат int