game

package
v0.0.0-...-dd92ee3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package game will hold the object and associated logic for the Game model.

game.Game will be what everything else game related hangs off of.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertGame

func InsertGame(game *Game) error

Types

type Game

type Game struct {
	ID          bson.ObjectId `bson:"_id,omitempty"`
	Name        string        //The Name of the Game
	Slug        string        //The slug used to identify the game in URLs
	Owner       string        //The email address of the Game's "owner"
	Description string        //The description of the game provided by its creator
	Timestamp   time.Time     //The time that the game was created
}

Game is the model that other game related models hang off of.

func CreateGame

func CreateGame(name string, owner string, description string) *Game

CreateGame takes the requested parameters and creates a new game instance.

type Player

type Player struct {
	ID         bson.ObjectId `bson:"_id,omitempty"`
	GameID     bson.ObjectId //The game that this player is connected to.
	UserID     bson.ObjectId //The User that this player is connected to.
	IsPlayer   bool          // Is this Player a member of the game, or just a lurker?
	IsWatching bool          // Are they actually watching the game?

}

Player acts as a subscription to a given game.

Directories

Path Synopsis
Package gamehandlers handles game related routes.
Package gamehandlers handles game related routes.

Jump to

Keyboard shortcuts

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