-
Notifications
You must be signed in to change notification settings - Fork 0
/
waypoint_group.go
21 lines (17 loc) · 887 Bytes
/
waypoint_group.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package years
import "time"
// WaypointGroup stands for a simple implementation of Waypoint that is a container for other waypoints
type WaypointGroup struct {
waypoints []Waypoint
identifier string
}
// NewWaypointGroup create a group for given waypoints
func NewWaypointGroup(identifier string, waypoints ...Waypoint) Waypoint {
return &WaypointGroup{identifier: identifier, waypoints: waypoints}
}
// Time returns group's time. For now group itself doesn't have a specific time
// TODO(nice-to-have): this maybe configurable, e.g. no-time/min-time(children)/max-time(children)/time(children[0]), etc
func (wg *WaypointGroup) Time() time.Time { return time.Time{} }
func (wg *WaypointGroup) Identifier() string { return wg.identifier }
func (wg *WaypointGroup) IsContainer() bool { return true }
func (wg *WaypointGroup) Children() []Waypoint { return wg.waypoints }