Skip to content

Commit 2879d35

Browse files
committed
Add docstring to Path
1 parent 84eb0c0 commit 2879d35

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/path.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1+
"""
2+
struct Path{T}
3+
4+
A `Path` is a sequence of `PathChange`s, beginning from some `initialview::ViewState`.
5+
It is callable with a single parameter `t`, which is the time since the start of the path at `t=0`.
6+
It returns the `ViewState` at time `t`.
7+
8+
To add a new `PathChange` to a `Path`, use the `*` operator. This is non-mutating and will construct a new path!
9+
"""
110
struct Path{T}
211
initialview::ViewState{T}
312
changes::Vector{PathChange{T}}
413
end
514
Path{T}(initialview::ViewState) where T = Path{T}(initialview, PathChange{T}[])
15+
16+
"""
17+
Path(initialview::ViewState{T}) where T
18+
19+
Construct a `Path` that starts at `initialview`.
20+
"""
621
Path(initialview::ViewState{T}) where T = Path{T}(initialview)
722

823
function Base.:*(path::Path{R}, change::PathChange{S}) where {R,S}

0 commit comments

Comments
 (0)