parent
7017ff9285
commit
ade74defe5
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Player.swift
|
||||
// DouShouQiIOS
|
||||
//
|
||||
// Created by Pierre FERREIRA on 13/05/2024.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
/// Représente un joueur
|
||||
public class Player {
|
||||
public let id: String
|
||||
public let name: String
|
||||
public let sname: String
|
||||
public let age: Int
|
||||
|
||||
/// Initialise un joueur
|
||||
public init?(withName name: String, andSName sname: String, andId id: String, andAge age : Int){
|
||||
// Vérification de la validité de l'identifiant
|
||||
guard id != "" else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.id = id
|
||||
self.name = name
|
||||
self.sname = sname
|
||||
self.age = age
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
//
|
||||
// FullButtonStyle.swift
|
||||
// DouShouQiIOS
|
||||
//
|
||||
// Created by Pierre FERREIRA on 13/05/2024.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
struct FullButtonStyle: ButtonStyle {
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
configuration.label
|
||||
.padding(10)
|
||||
.background(Color.yellow)
|
||||
.foregroundStyle(.white)
|
||||
.clipShape(Rectangle())
|
||||
.cornerRadius(15)
|
||||
}
|
||||
}
|
Loading…
Reference in new issue