-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.py
More file actions
69 lines (60 loc) · 2.29 KB
/
data.py
File metadata and controls
69 lines (60 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Literal, Self
from util import SideType, TriangleSideType
if TYPE_CHECKING:
from identifier import Identifier
from shapes import (BaseShapeCollection, NormalShapeCollection,
ZeroShapeCollection)
class Data(ABC):
@classmethod
@abstractmethod
def for_zero_triangle(
cls, /,
triangle_side_type: TriangleSideType, shapes: ZeroShapeCollection,
) -> Self:
raise NotImplementedError
@classmethod
@abstractmethod
def for_base_triangle(
cls, /,
triangle_side_type: TriangleSideType, identifier: Identifier,
shapes: BaseShapeCollection, above_identifier: Identifier,
above_shapes: BaseShapeCollection | ZeroShapeCollection,
above_data: Self,
) -> Self:
raise NotImplementedError
@classmethod
@abstractmethod
def for_horizontal_triangle(
cls, /,
triangle_side_type: TriangleSideType,
side: Literal[SideType.LEFT, SideType.RIGHT],
identifier: Identifier, shapes: NormalShapeCollection,
touching_horizontal_identifier: Identifier,
touching_horizontal_shapes: (NormalShapeCollection |
BaseShapeCollection),
touching_horizontal_data: Self,
touching_vertical_identifier: Identifier,
touching_vertical_shapes: (NormalShapeCollection |
BaseShapeCollection |
ZeroShapeCollection),
touching_vertical_data: Self,
) -> Self:
raise NotImplementedError
@classmethod
@abstractmethod
def for_vertical_triangle(
cls, /,
triangle_side_type: TriangleSideType,
side: Literal[SideType.LEFT, SideType.RIGHT],
identifier: Identifier, shapes: NormalShapeCollection,
touching_horizontal_identifier: Identifier,
touching_horizontal_shapes: (NormalShapeCollection |
BaseShapeCollection),
touching_horizontal_data: Self,
touching_vertical_identifier: Identifier,
touching_vertical_shapes: NormalShapeCollection,
touching_vertical_data: Self,
) -> Self:
raise NotImplementedError