ride

package
v0.0.0-...-693da34 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ride

type Ride struct {
	Route           Route
	VisitedStations []int64
	// contains filtered or unexported fields
}

Ride is a moving vehicle with passengers.

type Route

type Route struct {
	StationsIds []int64
	Schedules   []Schedule
	// contains filtered or unexported fields
}

Route is the order a ride visits stations.

func (*Route) AddStation

func (r *Route) AddStation(stationID int64, a stationAdder) error

AddStation adds a station to the route.

type Schedule

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

Schedule holds time data for ride

type Station

type Station struct {
	ID int64
	// contains filtered or unexported fields
}

Station is a stop for a ride TODO Add NewStation function to unsure unique id

func (*Station) AddRide

func (s *Station) AddRide(rideID int64) error

AddRide adds a ride to the station, returns error if rideId exists

Jump to

Keyboard shortcuts

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