weapon

package
v0.0.0-...-0723cb1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2015 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Target

type Target interface {
	Hit(int)
}

Target is an interface used by objects that can be hit and take damage

type Weapon

type Weapon struct {
	// contains filtered or unexported fields
}

Weapon is weapon with specific characteristics

func Create

func Create(maxRange int, damage int, name string,
	hitRate float64) Weapon

Create creates a new Weapon.

func (Weapon) Fire

func (weapon Weapon) Fire(rangeToTarget int, target Target)

Fire is used by an object to fire at a Target. Requires the range to the Target and the Target.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL