You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
814 B
31 lines
814 B
//
|
|
// BlocModel.swift
|
|
// SwiftMvvm
|
|
//
|
|
// Created by etudiant on 25/05/2023.
|
|
//
|
|
|
|
import Foundation
|
|
struct BlocModel: Identifiable ,Equatable {
|
|
static func == (lhs: BlocModel, rhs: BlocModel) -> Bool {
|
|
lhs.id == rhs.id
|
|
}
|
|
let id = UUID()
|
|
var Nombloc: String
|
|
var Moyenneg: Double
|
|
var listeUE: [UE]
|
|
public init(Nombloc: String, Moyenneg: Double, listeUE: [UE]) {
|
|
self.Nombloc = Nombloc
|
|
self.Moyenneg = Moyenneg
|
|
self.listeUE = listeUE
|
|
}
|
|
//a modifier l calcul de la moyenne
|
|
// func MoyenneBloc(bloc: BlocModel) -> Double {
|
|
// let sumOfMoyennes = bloc.listeUE.reduce(into: 0.0) { $0 + $1.MoyenneUE }
|
|
// let numberOfUEs = Double(bloc.listeUE.count)
|
|
// return sumOfMoyennes / numberOfUEs
|
|
// }
|
|
|
|
|
|
}
|