p

package module
v0.0.0-...-5417d07 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChooseFormula

func ChooseFormula(ctx context.Context, tx *firestore.Transaction, client *firestore.Client, userID string, user *game.User)

func GetBestPointsFormula

func GetBestPointsFormula(die []int, formulas []int) int

GetBestPointsFormula returns the formula with a max of points, with the provided die

func GetBoard

func GetBoard(ctx context.Context, tx *firestore.Transaction, client *firestore.Client, user *game.User) game.Board

func OnUpdateUser

func OnUpdateUser(ctx context.Context, e FirestoreEvent) error

OnUpdateUser is triggered when a user is updated - Sends new die when replay is queried

func ReplayDie

func ReplayDie(ctx context.Context, tx *firestore.Transaction, client *firestore.Client, userID string)

Types

type FirestoreEvent

type FirestoreEvent struct {
	OldValue myfirestore.FirestoreValue `json:"oldValue"`
	Value    myfirestore.FirestoreValue `json:"value"`
}

FirestoreEvent is the payload of a Firestore event. Please refer to the docs for additional information regarding Firestore events.

Jump to

Keyboard shortcuts

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