diff options
Diffstat (limited to 'examples/03-struct-generic/src/point.hob')
| -rw-r--r-- | examples/03-struct-generic/src/point.hob | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/03-struct-generic/src/point.hob b/examples/03-struct-generic/src/point.hob index 3ed314a..f923785 100644 --- a/examples/03-struct-generic/src/point.hob +++ b/examples/03-struct-generic/src/point.hob @@ -1,3 +1,13 @@ +/// A 2D drawing made up of straight lines. +struct LineDrawing2D { + field lines: Line[Point2D]; +} + +/// A drawing made up of straight lines. +struct LineDrawing[TPoint] { + field lines: Line[TPoint]; +} + /// A straight line from one point to another. struct Line[TPoint] { field start: TPoint; @@ -5,7 +15,7 @@ struct Line[TPoint] { } /// A 2D point. -struct Point { +struct Point2D { field x: Int32; field y: Int32; } |
