parent
dabe6998c2
commit
510cbd9d7c
@ -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()
|
||||
}
|
Loading…
Reference in new issue