utils

package
v2.0.0-...-f9990e0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoleToName

func RoleToName(role Role) string

RoleToName converts a role constant to its typical name.

func TimeFromUnix

func TimeFromUnix(t float64) time.Time

TimeFromUnix is a convenience function for converting the unix time returned from API responses into an actual golang time

Types

type Role

type Role int

Role is an enum describing all the roles within the game that players can have. Each player has uniquely one role.

const (
	// RoleInvalid is the default value meaning that there was a bug
	// that caused the player to not have a role set.
	RoleInvalid Role = 0

	// RolePlayer is the role of humans
	RolePlayer Role = 1

	// RoleEconomyAI is the role of AI's acting in a pair to control the
	// fiscal policy of the team
	RoleEconomyAI Role = 2

	// RoleMilitaryAI is the role of AI's acting in a pair to control the
	// defense and foreign policy of the team
	RoleMilitaryAI Role = 3

	// RoleScienceAI is the role of AI's acting in a pair to control the
	// scientific policy of the team
	RoleScienceAI Role = 4
)

func RoleFromName

func RoleFromName(role string) Role

func (Role) Name

func (r Role) Name() string

Name is an alternative way to call RoleToName

Jump to

Keyboard shortcuts

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