Skip to content

Commit

Permalink
Stage
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlaizg committed Aug 12, 2019
1 parent 6e48be0 commit 49e3b74
Show file tree
Hide file tree
Showing 11 changed files with 436 additions and 201 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.martinlaizg.geofind.data.access.database.entities;

import android.location.Location;

import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Ignore;
Expand Down Expand Up @@ -197,4 +199,26 @@ public String getImage() {
public void setImage(String image) {
this.image = image;
}

public Location getLocation() {
if(lat == null || lon == null) return null;
Location l = new Location("");
l.setLatitude(this.lat);
l.setLongitude(this.lon);
return l;
}

public void setLocation(Location location) {
if(location == null) return;
lat = location.getLatitude();
lon = location.getLongitude();
}

public void setCompleteQuestion(String question, String correctAnswer, String secondAnswer,
String thirdAnswer) {
this.question = question;
this.answer = correctAnswer;
this.answer2 = secondAnswer;
this.answer3 = thirdAnswer;
}
}
Loading

0 comments on commit 49e3b74

Please sign in to comment.