Database - NetanelAlbert/OopEx3-Map-Game GitHub Wiki

In dataBase package we have 3 classes:

  • DBHelper
  • MyGamesData
  • LogDao

DBHelper

In this class we have 2 importent static methods:

userInfo(int userId)

Return MyGamesData object with all the information from the server about this user.

placeInLevel(int levelID, int myScore)

return the the user place in this level, compared to the other players.

MyGamesData

Holding data of 1 user, mainly reeding from Database

insertIfBigger(LogDao log)

keep log if is better the the current log in same level

CheckSetCurrentLevel(int currentLevel)

replace currentLevel if the new is higher, to know in the end what is the highes level of the user.

increedGames()

Add 1 to playedGames, to count the games.

LogDao

This is a simple object that represent a row of data from dataBase. it has only constructor, getters and toString() to show the row.