clock

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrZeroRoundDuration = errors.New("round duration is zero")
	ErrStartTimeOrder    = errors.New("start time should before end time")
	ErrRestTimeFormat    = errors.New("rest time format error")
	ErrRestTimeOrder     = errors.New("rest start time should before end time")
	ErrRestTimeOverflow  = errors.New("rest time overflow")
	ErrRestTimeListOrder = errors.New("rest time list should in order")
)
View Source
var T = new(Clock)

Functions

func Init

func Init() error

func Start

func Start()

Start starts the game clock processor routine.

func Stop

func Stop()

Stop stops the game clock processor.

Types

type Clock

type Clock struct {
	StartAt             time.Time
	EndAt               time.Time
	RoundDuration       time.Duration
	RestTime            [][]time.Time
	RunTime             [][]time.Time
	TotalRound          uint
	CurrentRound        uint
	RoundRemainDuration time.Duration
	Status              Status
	// contains filtered or unexported fields
}

type Status

type Status int
const (
	StatusWait Status = iota
	StatusRunning
	StatusPause
	StatusEnd
)

Jump to

Keyboard shortcuts

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