-
Notifications
You must be signed in to change notification settings - Fork 0
/
Objects.wsd
143 lines (120 loc) · 2.46 KB
/
Objects.wsd
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
@startuml lunar-lander
skinparam groupInheritance 3
title lunar-lander
Interface PhysicalObject{
#m_collisions_enabled: bool
+{abstract}update(float dt)
}
class RigidBody{
#m_gravity_enabled: bool
#m_weight: int
#m_rotation_inertia: float
#m_position: SDL_FPoint
#m_rotation: float
#m_speed: SDL_FPoint
#m_rotation_speed: float
#m_overall_force: SDL_FPoint
+set_position()
+set_speed()
+move()
+rotate()
+set_rotation()
+set_rotation_speed()
+apply_force()
}
class StaticObject{
}
interface GraphicalObject{
-color: SDL_Color
+set_color()
+get_color()
+{abstract} invoke_render(Renderer&)
}
class GraphicalPoints{
+points_are_connected: bool
+invoke_renderer(Renderer&)
+get_points() const: SDL_Point*
+set_points(&vector<SDL_Point>)
+get_size(): int
-points: vector<SDL_Point>
}
class GraphicalText{
#m_rect: SDL_Rect
#m_modified: bool
#text: string
#font: font_type
+get_quad()
+set_position()
+set_size()
+invoke_renderer(Renderer&)
+set_text(string, font_type)
+get_text()
+get_font
}
class GraphicalBitmap{
}
interface GameObject{
+{abstract}draw(SDL_Renderer*)
+{abstract}update(float dt)
}
class Game{
+Game()
+~Game()
+start()
+finish()
+get_user_input()
+update()
}
class GameWindow{
+GameWindow()
+~GameWindow()
-graphical_objects: list<GameObjects>
-SDL_Window
-renderer: unique_ptr<Renderer>
+update_graphics()
+add_new_graphical_object()
}
class Renderer{
+Renderer(SDL_Window*)
+~Renderer()
+set_drawing_color(SDL_Color)
+clear_screen()
+show_screem()
+render_line(GraphicalLines*)
+render_text(GraphicalText*)
-renderer: SDL_Renderer*
-fonts: array
-textures_for_text_rendering: unordered_map
}
class InputHandler{
+subscribe_action()
+delete_action()
+handle_game_input()
}
class Player{
+points
+add_points()
+evaluate_landing()
}
class Physics{
-physical_objects: list
+update_physics()
-check_collisions()
}
class UI{
+draw()
-ui_elements: vector
}
Game *-- Physics
Game *-- Player
Game *-- GameWindow
Game *-- UI
GameWindow *-down- Renderer
GameWindow *-- InputHandler
PhysicalObject <|-- RigidBody
PhysicalObject <|-- StaticObject
GraphicalObject <|.. GraphicalPoints
GraphicalObject <|.. GraphicalText
GraphicalObject <|.. GraphicalBitmap
GameObject <|-- UI
UI *-- GraphicalText