Commit 6d735ca7 authored by Zachary Seguin's avatar Zachary Seguin

Add comments to exported types and functions

parent a73c5230
Pipeline #112 passed with stages
in 1 minute and 28 seconds
......@@ -6,9 +6,11 @@ import (
"git.zacharyseguin.ca/trainsim/trainsim/track"
)
// Dijkstra Algorithm implementation for path finding.
type Dijkstra struct {
}
// FindPath finds the shortest path between two track segments.
func (f *Dijkstra) FindPath(tr *track.Track, from string, to string) (*Path, error) {
dist := make(map[string]float64)
prev := make(map[string]string)
......
......@@ -4,6 +4,7 @@ import (
"fmt"
)
// Segments are the track segments, listed by ID.
type Segments map[string]*Segment
// Track details the track.
......@@ -11,6 +12,7 @@ type Track struct {
Segments Segments `yaml:"segments" json:"segments"`
}
// UnmarshalYAML decodes track segments.
func (segs *Segments) UnmarshalYAML(unmarshal func(interface{}) error) error {
aux := make(Segments, 0)
if err := unmarshal(aux); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment