-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass-structure-document.txt
More file actions
211 lines (180 loc) · 5.44 KB
/
Copy pathclass-structure-document.txt
File metadata and controls
211 lines (180 loc) · 5.44 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
Inheritance Structure
* Player <- MonoBehaviour
* PlayerState
* abTool <- MoveableObj <- ObjInterface <- MonoBehaviour
* BasicWin <- MonoBehaviour
* CollisionSorter <- IComparer<Collider2D>
* Dialogue <- MonoBehaviour
* ImmovableObj <- ObjInterface <- MonoBehaviour
* Melt <- MonoBehaviour
* MoveableObj <- ObjInterface <- MonoBehaviour
* ObjInterface <- MonoBehaviour
* UImanager <- MonoBehaviour
# Handles all player input and sends it out as necessary
# Should not be sent directly to any of the other game objects. Only its state
# should be sent
public class Player : MonoBehaviour
Fields:
private:
-> CollisionSorter collisionSorter
-> MoveableObj? heldObj
-> PlayerState player
-> Vector2 mousePos
-> ContactFilter2D contactFilter
-> bool[] MBPressed
-> bool[] MBReleased
Methods:
public:
-> void OnMouseMove(InputAction.CallbackContext ctx)
-> void OnMousePrimary(InputAction.CallbackContext ctx)
-> void OnMouseSecondary(InputAction.CallbackContext ctx)
-> void QuitGame(InputAction.CallbackContext ctx)
-> void RestartGame(InputAction.CallbackContext ctx)
private:
-> ObjInterface? GetTopCollision()
-> bool GrabObj(ObjInterface? obj)
-> void DropObj()
-> bool IsHoldingObj()
-> PlayerState SetPlayerState()
public class UImanager : MonoBehaviour
Fields:
private:
-> bool caseRemoved
-> bool iceMelted
-> bool partsReassembled
-> int objectiveNum
-> TextMeshProUGUI objectives
-> BasicWin b
Methods:
private:
-> void Start()
-> void Update()
public class BasicWin : MonoBehaviour
Fields:
public:
-> bool won
-> MoveableObj[] parts
-> int iceCount
-> SpriteRenderer victory
Methods:
pubic:
-> void updateIceCount()
private:
-> void Update()
public class Melt : MonoBehaviour
Fields:
public:
-> SpriteRenderer spr
private:
-> float meltRate
-> float minSize
-> Sprite lighterOff
-> Sprite lighterOn
-> BasicWin b
Methods:
public:
-> void GetMouseDown(InputAction.CallbackContext ctx)
private:
-> void Update()
-> void OnMouseOver()
public class Dialogue : MonoBehaviour
Fields:
public:
-> TextMeshProUGUI textComponent
-> string[] lines
-> float textSpeed
private:
-> int index
-> bool isTyping
-> bool dialogueEnded
Methods:
private:
-> void Start()
-> void OnDialogueClick()
-> void StartDialogue()
-> IEnumerator TypeLine()
-> void NextLine()
-> void EndDialogue()
public:
-> void GetMouseDown(InputAction.CallbackContext ctx)
public class CollisionSorter : IComparer<Collider2D>
Methods:
public:
-> int Compare(Collider2D x, Collider2D y)
public class ImmovableObj: ObjInterface
Methods:
public:
-> override void ParentPositionChanges(Vector3 newPos)
-> override void GetInput(PlayerState player)
public class MoveableObj : ObjInterface
Fields:
public:
-> Sprite sprite
-> Sprite highlightSprite
-> PlayerState player
-> bool snapped
-> ObjInterface[] coveredObjs
protected:
-> float snapDistance
-> bool dragging
-> Vector3 offset
-> Vector3 snapPosition
-> Collider2D objCollider
Methods:
public:
-> override void ParentPositionChange(Vector3 newPos)
-> override void UpdateMousePosition(Vector3 newPos)
-> override void GetInput(PlayerState player)
-> void PickUpObj(PlayerState player)
-> void SetDownObj()
protected:
-> virtual void HeldUse(PlayerState player)
private:
-> void Start()
-> void Update()
-> void OnMouseOver()
-> void OnMouseExit()
public abstract class ObjInterface : MonoBehaviour
Constants:
public:
-> string EMPTY_OBJ_ID = "EMPTY"
Fields:
public:
-> string id
-> bool covered
-> ObjInterface[] childObjs
protected:
-> Dictionary<string, Vector3> offsets
Methods:
public:
-> abstract void GetInput(PlayerState player)
-> abstract void ParentPositionChange(Vector3 newPos)
protected:
-> void Move(Vector3 newPos)
public abstract class abTool : MoveableObject
Methods:
pubic:
-> override void GetInput(PlayerState player)
-> abstract void HeldUse(PlayerState player)
-> abstract void StartBaseUse()
-> abstract void EndBaseUse()
public struct PlayerState
Constants:
private:
-> int NUM_OF_BUTTONS = 2
Fields:
private:
-> bool[] MBPressed
-> bool[] MBReleased
-> bool[] MBHeld
-> Vector2 mousePos
-> MoveableObject? heldObj
Methods:
public:
-> PlayerState(bool[] MBPressed, bool[] MBReleased, Vector2 mousePos, MoveableObj? heldObj)
-> int GetNumButtons()
-> bool GetMBPressed(int button)
-> bool GetMBReleased(int button)
-> bool GetMBHeld(int button)
-> Vector2 GetMousePos()
-> MoveableObj? GetHeldObj()