summaryrefslogtreecommitdiffstats
path: root/android/src/ch/asynk/rustanddust
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-31 01:51:59 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-31 01:51:59 +0100
commit8244dd3748900fa7beb3dd78a62382fc21989a2c (patch)
tree78accbb97f1e8d2d22249ea309bcc8f7f72b8442 /android/src/ch/asynk/rustanddust
parent3d1f6cbaabf630f5a334f43183ff75e06fbf1ee5 (diff)
downloadRustAndDust-8244dd3748900fa7beb3dd78a62382fc21989a2c.zip
RustAndDust-8244dd3748900fa7beb3dd78a62382fc21989a2c.tar.gz
Backend: add init(), getMyId() and getOpponentId()
Diffstat (limited to 'android/src/ch/asynk/rustanddust')
-rw-r--r--android/src/ch/asynk/rustanddust/android/AndroidBackend.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/android/src/ch/asynk/rustanddust/android/AndroidBackend.java b/android/src/ch/asynk/rustanddust/android/AndroidBackend.java
index c1650ad..6e0c581 100644
--- a/android/src/ch/asynk/rustanddust/android/AndroidBackend.java
+++ b/android/src/ch/asynk/rustanddust/android/AndroidBackend.java
@@ -3,13 +3,25 @@ package ch.asynk.rustanddust.android;
import android.app.Application;
import ch.asynk.rustanddust.Backend;
+import ch.asynk.rustanddust.RustAndDust;
public class AndroidBackend implements Backend
{
+ private int me;
+ private int opponent;
private Application app;
public AndroidBackend(Application app)
{
this.app = app;
}
+
+ public int getMyId() { return me; }
+ public int getOpponentId() { return opponent; }
+
+ public void init(RustAndDust game)
+ {
+ me = game.db.storePlayerGetId("me", "myself", "I");
+ opponent = game.db.storePlayerGetId("opponent", "other", "you");
+ }
}