-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Game.java
123 lines (103 loc) · 3.35 KB
/
Game.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package org.dolphinemu.dolphinemu.model;
import android.content.ContentValues;
import android.database.Cursor;
import android.os.Environment;
public final class Game
{
public static final int PLATFORM_GC = 0;
public static final int PLATFORM_WII = 1;
public static final int PLATFORM_WII_WARE = 2;
public static final int PLATFORM_ALL = 3;
// Copied from IVolume::ECountry. Update these if that is ever modified.
public static final int COUNTRY_EUROPE = 0;
public static final int COUNTRY_JAPAN = 1;
public static final int COUNTRY_USA = 2;
public static final int COUNTRY_AUSTRALIA = 3;
public static final int COUNTRY_FRANCE = 4;
public static final int COUNTRY_GERMANY = 5;
public static final int COUNTRY_ITALY = 6;
public static final int COUNTRY_KOREA = 7;
public static final int COUNTRY_NETHERLANDS = 8;
public static final int COUNTRY_RUSSIA = 9;
public static final int COUNTRY_SPAIN = 10;
public static final int COUNTRY_TAIWAN = 11;
public static final int COUNTRY_WORLD = 12;
public static final int COUNTRY_UNKNOWN = 13;
private static final String PATH_SCREENSHOT_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/dolphin-emu/ScreenShots/";
private String mTitle;
private String mDescription;
private String mPath;
private String mGameId;
private String mScreenshotPath;
private String mCompany;
private int mPlatform;
private int mCountry;
public Game(int platform, String title, String description, int country, String path, String gameId, String company, String screenshotPath)
{
mPlatform = platform;
mTitle = title;
mDescription = description;
mCountry = country;
mPath = path;
mGameId = gameId;
mCompany = company;
mScreenshotPath = screenshotPath;
}
public int getPlatform()
{
return mPlatform;
}
public String getTitle()
{
return mTitle;
}
public String getDescription()
{
return mDescription;
}
public String getCompany()
{
return mCompany;
}
public int getCountry()
{
return mCountry;
}
public String getPath()
{
return mPath;
}
public String getGameId()
{
return mGameId;
}
public String getScreenshotPath()
{
return mScreenshotPath;
}
public static ContentValues asContentValues(int platform, String title, String description, int country, String path, String gameId, String company)
{
ContentValues values = new ContentValues();
String screenPath = PATH_SCREENSHOT_FOLDER + gameId + "/thumb.png";
values.put(GameDatabase.KEY_GAME_PLATFORM, platform);
values.put(GameDatabase.KEY_GAME_TITLE, title);
values.put(GameDatabase.KEY_GAME_DESCRIPTION, description);
values.put(GameDatabase.KEY_GAME_COUNTRY, company);
values.put(GameDatabase.KEY_GAME_PATH, path);
values.put(GameDatabase.KEY_GAME_ID, gameId);
values.put(GameDatabase.KEY_GAME_COMPANY, company);
values.put(GameDatabase.KEY_GAME_SCREENSHOT_PATH, screenPath);
return values;
}
public static Game fromCursor(Cursor cursor)
{
return new Game(cursor.getInt(GameDatabase.GAME_COLUMN_PLATFORM),
cursor.getString(GameDatabase.GAME_COLUMN_TITLE),
cursor.getString(GameDatabase.GAME_COLUMN_DESCRIPTION),
cursor.getInt(GameDatabase.GAME_COLUMN_COUNTRY),
cursor.getString(GameDatabase.GAME_COLUMN_PATH),
cursor.getString(GameDatabase.GAME_COLUMN_GAME_ID),
cursor.getString(GameDatabase.GAME_COLUMN_COMPANY),
cursor.getString(GameDatabase.GAME_COLUMN_SCREENSHOT_PATH));
}
}