summaryrefslogtreecommitdiff
path: root/examples/03-struct-generic/src/point.hob
blob: ec6d76e92a4c4075adf9adf2547b4242cfbb0ac0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/// A 2D drawing made up of straight lines.
struct LineDrawing2D {
    field lines: List[Line[Point2D]];
}

/// A drawing made up of straight lines.
struct LineDrawing[TPoint] {
    field lines: List[Line[TPoint]];
}

/// A straight line from one point to another.
struct Line[TPoint] {
    field start: TPoint;
    field end: TPoint;
}

/// A 2D point.
struct Point2D {
    field x: Int32;
    field y: Int32;
}