From 4453cc43eec4103a761373063852091bbe2bb426 Mon Sep 17 00:00:00 2001
From: Lukas Woyke <l.woyke@outlook.de>
Date: Thu, 11 Feb 2021 00:22:08 +0100
Subject: [PATCH] More comments

---
 .../GameViews/GameViewController.swift        |  1 +
 .../Mutiplayer/LocalTeamPlayManager.swift     | 61 +++++++++++++++++++
 2 files changed, 62 insertions(+)

diff --git a/Better Together/Better Together/GameViews/GameViewController.swift b/Better Together/Better Together/GameViews/GameViewController.swift
index 5151085..a47a271 100644
--- a/Better Together/Better Together/GameViews/GameViewController.swift	
+++ b/Better Together/Better Together/GameViews/GameViewController.swift	
@@ -10,6 +10,7 @@ import SpriteKit
 import GameplayKit
 import MultipeerConnectivity
 
+/// View Controller that manages the game scene in single play mode, as well as in mulitplayer mode.
 class GameViewController: UIViewController, LocalTeamPlayDelegate {
     
     var gamePlayMode: PlayMode? = nil
diff --git a/Better Together/Better Together/Mutiplayer/LocalTeamPlayManager.swift b/Better Together/Better Together/Mutiplayer/LocalTeamPlayManager.swift
index 3039593..d62111f 100644
--- a/Better Together/Better Together/Mutiplayer/LocalTeamPlayManager.swift	
+++ b/Better Together/Better Together/Mutiplayer/LocalTeamPlayManager.swift	
@@ -296,3 +296,64 @@ extension Notification.Name {
     static let gameResultReceived = Notification.Name(rawValue: "gameResultReceived")
     static let dimissedInvitationBrowserClient = Notification.Name(rawValue: "dismissedInvitationClient")
 }
+
+
+/* ************************************************** Setup process in multiplayer mode ************************************************** */
+//
+//
+//      ┌────────────────────────────┐                            ┌────────────────────────────┐
+//      │           Server           │                            │           Client           │
+//      └────────────────────────────┘                            └────────────────────────────┘
+//                     │                  ┌────────────────────┐                 │
+//                     │                  │  Send Invitation   │                 │
+//                     ├──────────────────┴────────────────────┴────────────────▶│
+//                     │                  ┌────────────────────┐                 │
+//                     │                  │ Accept invitation  │                 │
+//                     │◀─────────────────┴────────────────────┴─────────────────┼─
+//      ┌──────────────┤                                                         │
+//      │ Wait for all │                                                         │
+//      │   clients    │                  ┌────────────────────┐                 │
+//      └──────────────┤                  │  send Invitation   │                 │
+//                     ├──────────────────┴────────────────────┴────────────────▶│
+//                     │              ┌────────────────────────────┐             │
+//                     │              │ Send clients customization │             │
+//                     │◀─────────────┴────────────────────────────┴─────────────┤
+//                     │              ┌────────────────────────────┐             │
+//                     │              │    Send selected level     │             │
+//                     ├──────────────┴────────────────────────────┴────────────▶│
+//                     │              ┌────────────────────────────┐             │
+//                     │              │       Confirm level        │             │
+//                     │◀─────────────┴────────────────────────────┴─────────────│
+//      ┌──────────────┤                                                         │
+//      │ Wait for all │                                                         │
+//      │   clients    │              ┌────────────────────────────┐             │
+//      └──────────────┤              │      Send player info      │             │
+//                     ├──────────────┴────────────────────────────┴────────────▶│
+//                     │              ┌────────────────────────────┐             │
+//                     │              │        Confirm info        │             │
+//                     │◀─────────────┴────────────────────────────┴─────────────┤
+//      ┌──────────────┤                                                         │
+//      │ Wait for all │                                                         │
+//      │   clients    │              ┌────────────────────────────┐             │
+//      └──────────────┤              │      Send start game       │             │
+//                     ├──────────────┴────────────────────────────┴────────────▶│
+//                     │              ┌────────────────────────────┐             │
+//                     │              │   Send game scene loaded   │             │
+//                     │◀─────────────┴────────────────────────────┴─────────────┤
+//      ┌──────────────┤                                                         │
+//      │ Wait for all │                                                         │
+//      │   clients    │                                                         │
+//      └──────────────┤              ┌────────────────────────────┐             │
+//                     │              │     Send game started      │             │
+//                     ├──────────────┴────────────────────────────┴────────────▶│
+//                     │                                                         │
+//                     │                                                         │
+//                     │                                                         │
+//                     │                                                         │
+//                     │                                                         │
+//                     │                                                         │
+//                     │                                                         │
+//                     ▼                                                         ▼
+//
+//
+/* ********************************************************************************************************************************** */
-- 
GitLab