world

package
v0.0.0-...-9bbeb27 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CityLock

type CityLock struct{ sync.Mutex }

type World

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

func LoadWorld

func LoadWorld(mapFilename string) World

Assumption: I dont assume is a planar graph, nor 4-regular. Assumption: routes are two-way but a city recieving a route from the north might a north route goin to another city. Ex.:

Foo south=Bar
Bar north=Extra

func New

func New(worldMap simple.UndirectedGraph, cityIds map[int]string, invCityIds map[string]int) World

func (World) CityName

func (w World) CityName(city int) string

func (*World) DestroyCity

func (w *World) DestroyCity(city int)

func (*World) LockCity

func (w *World) LockCity(city int)

func (World) NumberOfCities

func (w World) NumberOfCities() int

func (World) NumberOfRoutes

func (w World) NumberOfRoutes() int

func (World) NumberOfRoutesOut

func (w World) NumberOfRoutesOut(cityId int) int

func (World) PrintWorld

func (w World) PrintWorld()

func (World) RandomNeighboringCity

func (w World) RandomNeighboringCity(cityId int) int

func (World) RoutesOut

func (w World) RoutesOut(cityId int) []int

func (*World) UnlockCity

func (w *World) UnlockCity(city int)

Jump to

Keyboard shortcuts

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