Mercurial > public > geoquiz
comparison GeoQuiz/Logic/GameProtocol+Extension.swift @ 20:e281791e0494
finish implementation
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Sun, 23 Oct 2022 11:48:39 +0100 |
parents | f140bb277c96 |
children |
comparison
equal
deleted
inserted
replaced
19:f140bb277c96 | 20:e281791e0494 |
---|---|
108 } | 108 } |
109 | 109 |
110 func save(_ gameType: GameType, with moc: NSManagedObjectContext) { | 110 func save(_ gameType: GameType, with moc: NSManagedObjectContext) { |
111 let playedGame = PlayedGame(context: moc) | 111 let playedGame = PlayedGame(context: moc) |
112 | 112 |
113 playedGame.id = UUID() | |
114 playedGame.type = gameType | 113 playedGame.type = gameType |
115 playedGame.date = Date() | 114 playedGame.date = Date() |
116 playedGame.score = Int32(userScore) | 115 playedGame.score = Int32(userScore) |
117 playedGame.correctAnswers = Array(correctAnswers.keys) | 116 playedGame.correctAnswers = Array(correctAnswers.keys) |
118 playedGame.wrongAnswers = Array(wrongAnswers.keys) | 117 playedGame.wrongAnswers = Array(wrongAnswers.keys) |