player

package
v0.0.0-...-25cfde2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

code generated by hasgo. [DO NOT EDIT!]

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Player

type Player struct {
	Nick  string
	Score int
}

Player represents a person in an online game.

type Players

type Players []Player

Players is a wrapper for the []Player slice. go:generate hasgo -T=Player -S=Players

func (Players) Filter

func (s Players) Filter(f func(Player) bool) (out Players)

func (Players) Head

func (s Players) Head() (out Player)

Returns the first element in the slice If no element is found, returns the zero-value of the type

func (Players) Init

func (s Players) Init() (out Players)

Take n-1 elements from a slice, where n = len(list)

func (Players) Last

func (s Players) Last() (out Player)

Returns the last element in the slice If no element is found, returns the zero-value of the type

func (Players) Reverse

func (s Players) Reverse() (out Players)

Returns the reversed slice

func (Players) Tail

func (s Players) Tail() (out Players)

Take [1 -> n] elements from a slice, where n = len(list) Returns an empty slice if there are less than 2 elements in slice

func (Players) Uncons

func (s Players) Uncons() (head Player, tail Players)

Jump to

Keyboard shortcuts

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