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
파일 보기 프로젝트 열기: Bacon41/PantheonPrototype

보호된 프로퍼티들

프로퍼티 타입 설명
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