Back to godoc.org

Package blackjack

v0.0.0-...-b30913e
Latest Go to latest

The highest tagged major version is .

Published: Mar 24, 2017 | License: MIT | Module: github.com/Vladimir37/Backlun

Index

Variables

var CurrentGames []Game
var EndedGames []Game

func AllPlayersCicle

func AllPlayersCicle(game *Game)

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

CORSMiddleware middleware headers for any RESTful requests {{{

func CheckCardsLen

func CheckCardsLen(game *Game) bool

func CheckFullWinners

func CheckFullWinners(game *Game) bool

func DeactivateGame

func DeactivateGame(token string)

func FindPlayer

func FindPlayer(token string) (int, error)

func GenerateToken

func GenerateToken(strlen int) string

func GetAllEndedGames

func GetAllEndedGames(c *gin.Context)

func GetAllGames

func GetAllGames(c *gin.Context)

func GetGame

func GetGame(c *gin.Context)

func MakeDecision

func MakeDecision(value int) bool

func Start

func Start(args []string)

func StartGame

func StartGame(c *gin.Context)

func StopTakeGame

func StopTakeGame(c *gin.Context)

func TakeCardGame

func TakeCardGame(c *gin.Context)

type Card

type Card struct {
	Name  string
	Type  string
	Suit  string
	Value int
}

func GenerateDeck

func GenerateDeck() []Card

func TakeCard

func TakeCard(game *Game, player *Player) Card

type Game

type Game struct {
	Ended        bool
	FinalMessage string
	Winner       []Player
	Cards        []Card
	Players      []Player
	Token        string
}

type Player

type Player struct {
	Name  string
	User  bool
	Stay  bool
	Cards []Card
	Sum   int
}

func GeneratePlayer

func GeneratePlayer(num int) []Player

type StartReq

type StartReq struct {
	Players int `form:"players" binding:"required"`
	Decks   int `form:"decks"`
}

type TokenReq

type TokenReq struct {
	Token string `form:"token" binding:"required"`
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier