From 510cbd9d7c28ea863c088b3518de939f3015226d Mon Sep 17 00:00:00 2001 From: Mathieu GROUSSEAU Date: Wed, 28 May 2025 08:33:04 +0200 Subject: [PATCH] WIP Ingame view --- App/App/View/IngameView.swift | 75 +++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 App/App/View/IngameView.swift diff --git a/App/App/View/IngameView.swift b/App/App/View/IngameView.swift new file mode 100644 index 0000000..d2b7c56 --- /dev/null +++ b/App/App/View/IngameView.swift @@ -0,0 +1,75 @@ +// +// IngameView.swift +// App +// +// Created by etudiant2 on 21/05/2025. +// + +import SwiftUI + +struct IngameView: View { + var body: some View { + HStack { + PlayerView(is_local: true) + Spacer() + PlayerView(is_local: false) + } + + Spacer() + + Rectangle().aspectRatio(contentMode: .fit) + + Spacer() + + // Button("", systemImage: "globe") { + // + // } + + let current = "???" + Text("inGame.currentRules \(current)") + } +} + +private struct PlayerView: View { + let isLocal: Bool + + var body: some View { + VStack { + HStack { + let textAlignment: HorizontalAlignment = if self.isLocal { + .leading + } else { + .trailing + } + + if self.isLocal { + Circle().frame(width: 50, height: 50) + } + VStack(alignment: textAlignment) { + let name = "Name ???" + Text(name) + + let type = "Type ???" + Text(type) + } + if !self.isLocal { + Circle().frame(width: 50, height: 50) + } + } + + let time = "??:??:??" + Text(time) + + let statusText = "Status Text: Your turn" + Text(statusText) + } + } + + init(is_local isLocal: Bool) { + self.isLocal = isLocal + } +} + +#Preview { + IngameView() +}