hex

package module
v0.0.0-...-726f167 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: GPL-3.0 Imports: 19 Imported by: 0

README

hex

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(addr string)

Serve the http requests

Types

type CName

type CName int

CName are collection name's shorthand

const (
	// USERS user collection
	USERS CName = iota
)

func (CName) String

func (c CName) String() string

type Card

type Card struct {
	Name        string
	Picture     string
	Description string
	Type        CardType
	Energy      uint
	Rarity      uint
}

Card instance

type CardRarity

type CardRarity uint

CardRarity is rarity of the card depends on the color of the banner behind its name, regardless of the card's faction

const (
	// COMMON cards have a grey banner
	COMMON CardRarity = iota
	// UNCOMMON cards have a blue banner
	UNCOMMON
	// RARE cards have a gold banner
	RARE
)

type CardType

type CardType uint

CardType defines which type is the Card

const (
	// ATTACK is a reusable card (Unless it has Exhaust) that deals direct damage to an enemy and may have a secondary effect
	ATTACK CardType = iota
	// SKILL is a reusable card (Unless it has Exhaust) that has more unique effects to it. There isn't a clear direction with offensiveness and defensiveness unlike attacks
	SKILL
	// POWER is a permanent upgrade for the entire combat encounter. Some Powers give flat stats like Strength or Dexterity. Others require certain conditions to be met that combat. Each copy of a given power can only be played once per combat
	POWER
	// STATUS is Unplayable cards added to the deck during combat encounters. They are designed to bloat the deck and prevent the player from drawing beneficial cards, with some of them having additional negative effects. Unlike Curses, Status cards are removed from the deck at the end of combat
	STATUS
	// CURSE is Unplayable cards added to the deck during in-game events. Similar to status cards they are designed to bloat the deck and prevent the player from drawing beneficial cards, with some of them having additional negative effects during combat. Unlike Statuses, Curse cards persist in the players' deck until removed by other means
	CURSE
)

type DataBase

type DataBase struct {
	DB      *mongo.Database
	Context context.Context
}

DataBase is the struct to hold the mongodb instance and infos

func (*DataBase) EnsureIndex

func (db *DataBase) EnsureIndex(cName string, iName string) error

EnsureIndex is an util function to ensure index of a certain collection

type ICard

type ICard interface {
	GameStart()
	GameEnd()

	RoundStart()
	RoundEnd()

	DrawingStart()
	DrawingEnd()

	PlayingStart()
	PlayingEnd()
}

ICard inferface

type User

type User struct {
	Name       string
	LastUpdate time.Time
	Deck       []Card

	DiscardPile []Card
	ExhaustPile []Card
	DrawPile    []Card
}

User instance for holding all the data

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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