-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask3_class.pu
75 lines (67 loc) · 1.41 KB
/
task3_class.pu
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
70
71
72
73
74
75
@startuml
class Snake {
-static Snake theSnake
-Sorter sorter
+static Snake getTheSnake()
+void setSorter(Sorter sorter)
+String matrixUp(Matrix matrix)
+String[] parsePlan(String plan)
+void execute(String step)
}
class SelectSorter {
-int[][] a
+void load(int[][] elements)
+void sort()
+String getPlan()
+void swap(int i, int j, int x, int y)
}
class QuickSorter {
-int[][] a
+void load(int[][] elements)
+void sort()
+String getPlan()
+void swap(int i, int j, int x, int y)
+void QuickSorter(int left, int right)
}
class Monster {
-int r, g, b
-Monster[][] monsArray
-Position position
+void setPosition(Position position)
+Position getPosition()
+void swapPosition(Monster another)
+int getValue()
+Monster getArrayEle(int i, int j)
+Monster getMonsterByRank(int rank)
+int rank()
}
class Matrix {
-int n, m
-Position[][] positions
+void put(Linable linable, int i,int j)
+Linable get(int i, int j)
+Linable[][] toMatrix()
+void shuffle()
}
interface Sorter {
+void load(int[][] elements)
+void sort()
+String getPlan()
}
interface Linable {
+void setPosition(Position position)
+Position getPosition()
+int getValue()
}
class Position {
-Linable linable
+void setLinable(Linable linable)
}
Snake --> Sorter
Snake --> Matrix
SelectSorter ..|> Sorter
QuickSorter ..|> Sorter
Monster ..|> Linable
Matrix --> Position
Position --> Linable
@enduml