SaveScoreBoard.swift 918 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // SaveScoreBoard.swift
  3. // Learn Genie
  4. //
  5. // Created by Suraj Kumar Mandal on 24/09/21.
  6. //
  7. import Foundation
  8. import RealmSwift
  9. class SaveScoreBoard: Object {
  10. @objc dynamic var id = 0
  11. @objc dynamic var levelId = 0
  12. @objc dynamic var topicId = 0
  13. @objc dynamic var runs = 0
  14. @objc dynamic var wickets = 0
  15. @objc dynamic var noOfAttempts = 0
  16. @objc dynamic var student = 0
  17. @objc dynamic var synced = false
  18. override static func primaryKey() -> String? {
  19. return "topicId"
  20. }
  21. convenience init(id:Int, levelId:Int, topicId:Int, runs:Int, wickets:Int, noOfAttempts:Int, student:Int, synced:Bool) {
  22. self.init()
  23. self.id = id
  24. self.levelId = levelId
  25. self.topicId = topicId
  26. self.runs = runs
  27. self.wickets = wickets
  28. self.noOfAttempts = noOfAttempts
  29. self.student = student
  30. self.synced = synced
  31. }
  32. }