club

package
v0.0.0-...-c273660 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Club

type Club struct {
	// contains filtered or unexported fields
}

func New

func New(tableCount int) Club

creates new instance of club

func (*Club) AddClient

func (c *Club) AddClient(clientName string)

func (*Club) AddClientToQueue

func (c *Club) AddClientToQueue(clientName string)

adds client to queue

func (*Club) Close

func (c *Club) Close(endTime time.Time, price int, inputTimeFormat string)

inits closure proccess in club

func (*Club) DeleteClient

func (c *Club) DeleteClient(clientName string)

removes client name from all clients slice

func (*Club) EndClientSession

func (c *Club) EndClientSession(curClient client.Client, price int)

ends given client session and starts new if queue is not empty

func (Club) FindTableByClient

func (c Club) FindTableByClient(clientName string) int

returns index of the table searched by client name, set clientName = "" to search free table, if there are no such table returns -1

func (Club) GetIncome

func (c Club) GetIncome() []string

returns formatted income for all tables by slice

func (Club) IsInClub

func (c Club) IsInClub(clientName string) bool

checks if client is already came to club

func (Club) IsTableBusy

func (c Club) IsTableBusy(tableId int) bool

checks if given table is busy. If yes, returns true; if not, returns false

func (Club) QueueIsTooBig

func (c Club) QueueIsTooBig(maxSize int) bool

checks if queue is over limit size given in file

func (*Club) StartNewSession

func (c *Club) StartNewSession(curEventClient client.Client, price int, tableId int)

ends previous client session (if exists) and start new

Jump to

Keyboard shortcuts

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