-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServerSimplificatedpart2.puml
64 lines (53 loc) · 1.31 KB
/
ServerSimplificatedpart2.puml
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
@startuml
'https://plantuml.com/class-diagram class Server {
class RunGame{
-GameLogic gameLogic;
-ProtectedQueue<std::shared_ptr<GameCommand> > gammingEventQueue;
-std::vector<std::unique_ptr<GamingClient>> players;
-std::queue<std::shared_ptr<SnapShot> > replayQueue;
-std::atomic<bool> isClosed;
}
class GameLogic {
-b2World world;
-RLContactListener contact_listener;
-Ball ball;
-std::vector<Car> players;
-uint8_t goal;
-float time_left;
-uint8_t red_score;
-uint8_t blue_score;
}
class GamingClient {
- private:
- size_t id;
- Socket skt;
- BlockingQueue<std::shared_ptr<SnapShot>> snapEventQueue;
}
class ProtocolRecv {
- Socket& skt;
- bool was_closed;
- ProtectedQueue<std::shared_ptr<GameCommand> >& eventQueueRef;
- size_t id;
}
class ProtocolSend {
-Socket& skt;
-BlockingQueue<std::shared_ptr<SnapShot>>& snapEventQueue;
-bool was_closed;
-size_t id;
}
class SnapShot {
-std::vector<uint8_t> data;
}
class GameCommandHandler {
- bool isEndGame;
- size_t id;
- std::shared_ptr<GameCommand> command;
}
RunGame -up- GameLogic
RunGame -right GamingClient
GamingClient -up- ProtocolRecv
GamingClient -right- ProtocolSend
ProtocolRecv -up- GameCommandHandler
GameCommandHandler -left- GameCommand
GamingClient -up- SnapShot
@enduml