Class GameRepository
- java.lang.Object
-
- edu.cnm.deepdive.cardcombat.service.GameRepository
-
-
Constructor Summary
Constructors Constructor Description GameRepository(Context context)
The constructor initializes the context, the database, and the dao.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Completable
delete(Game game)
Deletes a scale record in the database.LiveData<Game>
get(long id)
Returns LiveData of a game, given its id.Completable
save(Game game)
Creates or updates a game record in the database.
-
-
-
Constructor Detail
-
GameRepository
public GameRepository(Context context)
The constructor initializes the context, the database, and the dao.- Parameters:
context
- The application context.
-
-
Method Detail
-
save
public Completable save(Game game)
Creates or updates a game record in the database.- Parameters:
game
- TheGame
.- Returns:
- A
Completable
indicating the success or failure of the creation/update.
-
delete
public Completable delete(Game game)
Deletes a scale record in the database.- Parameters:
game
- TheGame
.- Returns:
- A
Completable
indicating the success or failure of the deletion.
-
-