models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2015 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Collection *mgo.Collection
	Session    mgo.Session
)

Functions

func DeleteMonster

func DeleteMonster(id bson.ObjectId) error

func DeletePlayer

func DeletePlayer(id bson.ObjectId) error

func UpdateMonster

func UpdateMonster(id bson.ObjectId, monster Monster) error

func UpdatePlayer

func UpdatePlayer(id bson.ObjectId, player Player) error

Types

type Monster

type Monster struct {
	ID         bson.ObjectId `bson:"_id" json:"id"`
	Initiative int           `json:"initiative"`
	AC         int           `json:"ac"`
	HP         int           `json:"hp"`
	Health     int           `json:"health"`
	Damage     int           `json:"damage"`
	Speed      string        `json:"speed"`
	Monster    string        `json:"monster"`
	Challange  int           `json:"challange"`
	XP         int           `json:"xp"`
	Manual     int           `json:"manual"`
}

User stores a users name

func FindMonster

func FindMonster(id bson.ObjectId) (*Monster, error)

func InsertMonster

func InsertMonster(monster Monster) (*Monster, error)

func NewMonster

func NewMonster() *Monster

type Monsters

type Monsters []*Monster

User stores a users name

func PopulateMonsters

func PopulateMonsters() (*Monsters, error)

type Player

type Player struct {
	ID         bson.ObjectId `bson:"_id" json:"id"`
	Initiative int           `json:"initiative"`
	AC         int           `json:"ac"`
	HP         int           `json:"hp"`
	Health     int           `json:"health"`
	Damage     int           `json:"damage"`
	Speed      string        `json:"speed"`
	Name       string        `json:"name"`
	Character  string        `json:"character"`
}

User stores a users name

func FindPlayer

func FindPlayer(id bson.ObjectId) (*Player, error)

func InsertPlayer

func InsertPlayer(player Player) (*Player, error)

func NewPlayer

func NewPlayer() *Player

type Players

type Players []*Player

User stores a users name

func PopulatePlayers

func PopulatePlayers() (*Players, error)

Jump to

Keyboard shortcuts

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