├── .gitignore
├── AndroidManifest.xml
├── README.md
├── build.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── proguard-project.txt
├── res
└── values
│ └── colors_dota.xml
├── settings.gradle
├── src
└── nl
│ └── ansuz
│ └── android
│ └── steam
│ ├── SteamId.java
│ ├── dota
│ ├── request
│ │ ├── DotaRequest.java
│ │ ├── economy
│ │ │ ├── GetHeroes.java
│ │ │ └── GetRarities.java
│ │ └── match
│ │ │ ├── GetLeagueListing.java
│ │ │ ├── GetLiveLeagueGames.java
│ │ │ ├── GetMatchDetails.java
│ │ │ ├── GetMatchHistory.java
│ │ │ ├── GetMatchHistoryBySequenceNum.java
│ │ │ ├── GetScheduledLeagueGames.java
│ │ │ ├── GetTeamInfoByTeamId.java
│ │ │ └── GetTournamentPlayerStats.java
│ ├── response
│ │ ├── DotaResponse.java
│ │ ├── economy
│ │ │ ├── GetHeroesResponse.java
│ │ │ └── GetRaritiesResponse.java
│ │ └── match
│ │ │ ├── GetLeagueListingResponse.java
│ │ │ ├── GetLiveLeagueGamesResponse.java
│ │ │ ├── GetMatchDetailsResponse.java
│ │ │ ├── GetMatchHistoryBySequenceNumResponse.java
│ │ │ ├── GetMatchHistoryResponse.java
│ │ │ ├── GetScheduledLeagueGamesResponse.java
│ │ │ ├── GetTeamInfoByTeamIdResponse.java
│ │ │ └── GetTournamentPlayerStatsResponse.java
│ ├── util
│ │ ├── DotaBuildingStatus.java
│ │ ├── DotaReplayUrlBuilder.java
│ │ ├── HeroBuildItemList.java
│ │ ├── PlayerColors.java
│ │ ├── gson
│ │ │ ├── DotaDeserializer.java
│ │ │ └── TeamDetailsDeserializer.java
│ │ ├── heroes
│ │ │ ├── AbilityList.java
│ │ │ └── HeroVoComparator.java
│ │ └── matches
│ │ │ └── MatchVoComparator.java
│ └── vo
│ │ ├── AbilityUpgradeVO.java
│ │ ├── AdditionalUnitVO.java
│ │ ├── BuildItemVO.java
│ │ ├── HeroVO.java
│ │ ├── LeagueVO.java
│ │ ├── MatchVO.java
│ │ ├── PickBanVO.java
│ │ ├── PlayerVO.java
│ │ ├── RarityVO.java
│ │ ├── TeamDetailsVO.java
│ │ ├── TeamMatchTotalsVO.java
│ │ ├── TeamVO.java
│ │ ├── heroes
│ │ └── AbilityVO.java
│ │ ├── match
│ │ ├── LiveLeagueMatchVO.java
│ │ └── ScheduledLeagueMatchVO.java
│ │ ├── players
│ │ ├── BasePlayerVO.java
│ │ └── LiveLeaguePlayerVO.java
│ │ └── team
│ │ └── BaseTeamDetailsVO.java
│ ├── request
│ ├── ISteamRequest.java
│ ├── SteamRequest.java
│ ├── economy
│ │ ├── EconomyRequest.java
│ │ ├── GetPlayerItems.java
│ │ └── GetSchema.java
│ ├── remotestorage
│ │ └── GetUGCFileDetails.java
│ └── user
│ │ ├── GetPlayerSummaries.java
│ │ ├── ResolveVanityUrl.java
│ │ └── UserRequest.java
│ ├── response
│ ├── economy
│ │ └── GetSchemaResponse.java
│ ├── remotestorage
│ │ └── GetUGCFileDetailsResponse.java
│ └── user
│ │ ├── GetPlayerSummariesResponse.java
│ │ └── ResolveVanityUrlResponse.java
│ ├── util
│ ├── GsonUtil.java
│ └── SteamIdSolver.java
│ └── vo
│ ├── ResponseStatusVO.java
│ ├── economy
│ ├── ItemAttributeVO.java
│ ├── ItemCapabilitiesVO.java
│ ├── ItemOriginNamesVO.java
│ ├── ItemQualityNamesVO.java
│ ├── ItemQualityVO.java
│ ├── ItemSetVO.java
│ ├── ItemToolVO.java
│ ├── ItemVO.java
│ ├── ParticleVO.java
│ └── SchemaAttributeVO.java
│ ├── remotestorage
│ └── UgcFileDetailsVO.java
│ └── user
│ └── UserVO.java
└── tools
├── abilityparser
├── AbilitiesParser.cfg
├── AbilitiesParser.py
└── AbilityList.java
├── itemparser
├── BuildItemsParser.cfg
├── BuildItemsParser.py
└── HeroBuildItemList.java
└── ti3
├── README.md
├── main_event_day_01.json
├── main_event_day_02.json
├── main_event_day_03.json
├── main_event_day_04.json
├── main_event_day_05.json
├── prelims_day_00.json
├── prelims_day_01.json
├── prelims_day_02.json
└── prelims_day_03.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # Gradle
2 | .gradle/
3 | build/
4 | local.properties
5 |
6 | # Eclipse
7 | .classpath
8 | .project
9 | .pydevproject
10 | .settings/
11 | bin/
12 | gen/
13 | libs/
14 | project.properties
15 |
16 | # IntelliJ
17 | *.iml
18 | .idea/
19 |
20 | # DotA2 files
21 | tools/itemparser/items.txt
22 | tools/abilityparser/npc_abilities.txt
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | dota2-api-wrapper
2 | =================
3 |
4 | An Android API wrapper for Dota 2.
5 |
6 | ###Requirements
7 | * [Google GSON](http://code.google.com/p/google-gson/) (A library to convert JSON to Java and Java to JSON.)
8 | * (Optional) [Python](http://python.org/)
9 |
10 | ###Overview
11 | This project will deserialize DotA API responses into typed Java objects. Potentially saving you a lot of headache when dealing with JSON strings.
12 |
13 | ####Example
14 |
15 | Creating a request URL:
16 | ```java
17 | HashMap matchParams = new HashMap();
18 | matchParams.put(SteamRequest.Parameter.API_KEY,"your_steam_api_key");
19 | matchParams.put(GetMatchDetails.Parameter.MATCH_ID, "1219429");
20 |
21 | GetMatchDetails matchDetailsRequest = new GetMatchDetails();
22 | String url = matchDetailsRequest.createRequestUrl(DotaRequest.ApplicationID.BETA, matchParams);
23 | ```
24 |
25 | Parsing the response:
26 | ```java
27 | // Resonse String from the API.
28 | String apiResponse;
29 |
30 | GsonUtil util = new GsonUtil();
31 | Gson gson = new Gson();
32 |
33 | GetMatchDetailsResponse matchDetailsResponse = gson.fromJson(util.getStrippedDotaResult(apiResponse),
34 | GetMatchDetailsResponse.class);
35 | ```
36 |
37 | ###Generating HeroBuildItemList.java
38 | If you have Python installed you can generate the `src/nl/ansuz/android/steam/dota/util/HeroBuildItemList.java` file by running the BuildItemsParser Python script found in `tools/itemparser`.
39 |
40 | First extract `scripts/npc/items.txt` from `/Steam/steamapps/common/dota 2 beta/dota/pak01_dir.vpk` using [GCFScape](http://nemesis.thewavelength.net/index.php?p=26) or [VPKReader](https://github.com/hufuman/VPKReader) if GCFScape doesn't work.
41 |
42 | After this, tweak `tools/itemparser/BuildItemsParser.cfg` to meet your needs.
43 |
44 | Last, run `python tools/itemparser/BuildItemsParser.py`
45 |
46 | ###Generating AbilityList.java
47 | Pretty much the same as "Generating HeroBuildItemList.java" except for two small changes.
48 | First, make sure to extract `npc_abilities.txt` instead of `items.txt` from the vpk file.
49 | Second, use the Python script found under `tools/abilityparser/`.
50 |
51 | ###Player colours
52 | The player colours (as found on the in-game HUD) are listed in `res/values/colors_dota.xml`.
53 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | task wrapper(type: Wrapper) {
2 | gradleVersion = "1.8"
3 | }
4 |
5 | apply plugin: "android-library"
6 |
7 | buildscript {
8 | repositories {
9 | mavenCentral()
10 | }
11 |
12 | dependencies {
13 | // Android Gradle plugin.
14 | classpath 'com.android.tools.build:gradle:0.6.1'
15 | }
16 | }
17 |
18 | android {
19 | compileSdkVersion 18
20 | buildToolsVersion "18.0.1"
21 |
22 | defaultConfig {
23 | minSdkVersion = 8
24 | targetSdkVersion = 18
25 |
26 | versionCode = "1"
27 | versionName = "0.1"
28 | }
29 |
30 | sourceSets {
31 | main {
32 | manifest.srcFile "AndroidManifest.xml"
33 | java.srcDirs = ["src"]
34 | res.srcDirs = ["res"]
35 | }
36 | }
37 | }
38 |
39 | repositories {
40 | mavenCentral()
41 | }
42 |
43 | dependencies {
44 | // Libs:
45 | // Android API lvl 8
46 | compile group: "com.google.android", name: "android", version: "2.2.1"
47 | // GSON
48 | compile group: "com.google.code.gson", name: "gson", version: "2.2.2"
49 | }
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwarren/dota2-api-wrapper/9f945173f188c8587988870dcdbdcf53351e564c/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Oct 03 15:08:01 CEST 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/res/values/colors_dota.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | #2E6AE6
9 | #5DE6AD
10 | #AD00AD
11 | #DCD90A
12 | #E66200
13 |
14 |
15 | #E67AB0
16 | #92A440
17 | #5CC5E0
18 | #00771F
19 | #956000
20 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "dota2-api-wrapper"
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/SteamId.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam;
2 |
3 | /**
4 | * Representation of a Steam ID.
5 | *
6 | * @author Wijnand
7 | * @see https://developer.valvesoftware.com/wiki/SteamID
8 | */
9 | public class SteamId {
10 |
11 | /**
12 | * There are 8 universes of Steam accounts.
13 | *
14 | * @author Wijnand
15 | */
16 | public enum Universe {
17 | INDIVIDUAL_OR_UNSPECIFIED,
18 | PUBLIC,
19 | BETA,
20 | INTERNAL,
21 | DEV,
22 | RC;
23 |
24 | private static final Universe[] universeValues = Universe.values();
25 |
26 | public static Universe fromInteger(int i) {
27 | return universeValues[i];
28 | }
29 | }
30 |
31 | /**
32 | * There are ten known account types for a Steam account, of which only 3
33 | * can be created today.
34 | *
35 | * @author Wijnand
36 | */
37 | public enum AccountType {
38 | INVALID,
39 | INDIVIDUAL,
40 | MULTISEAT,
41 | GAME_SERVER,
42 | ANON_GAME_SERVER,
43 | PENDING,
44 | CONTENT_SERVER,
45 | CLAN,
46 | CHAT,
47 | P2P_SUPER_SEEDER,
48 | ANONUSER;
49 |
50 | private static final AccountType[] typeValues = AccountType.values();
51 |
52 | public static AccountType fromInteger(int i) {
53 | return typeValues[i];
54 | }
55 | }
56 |
57 | public final static String TEXTUAL_PREFIX = "STEAM_";
58 | public final static String TEXTUAL_SEPARATOR = ":";
59 | public final static long ACCOUNT_TO_ID_OFFSET = 76561197960265728L;
60 |
61 | private String textualId;
62 | private long id64Bits;
63 |
64 | private int accountNumber;
65 | private int accountInstance;
66 | private AccountType accountType;
67 | private Universe accountUniverse;
68 |
69 | /**
70 | * SteamIDs follow a fairly simple format when represented textually:
71 | * "STEAM_X:Y:Z", where X, Y and Z are integers. In select cases
72 | * "STEAM_ID_PENDING" or "UNKNOWN" are used (see the section 'Types of Steam
73 | * Accounts' for more details).
74 | *
75 | * X represents the "Universe" the steam account belongs to.
76 | * Y is part of the ID number for the account. Y is either 0 or 1.
77 | * Z is the ID number for the account (the "account number").
78 | *
79 | * @param textualId The textual Steam ID to parse.
80 | */
81 | public SteamId(String textualId) {
82 | this.textualId = textualId;
83 |
84 | accountUniverse = getUniverseFromTextual(textualId);
85 | accountNumber = getAccountFromTextual(textualId);
86 | id64Bits = accountNumber + ACCOUNT_TO_ID_OFFSET;
87 |
88 | // Assumptions:
89 | accountInstance = 1;
90 | accountType = AccountType.INDIVIDUAL;
91 | }
92 |
93 | /**
94 | * When represented internally in computer programs the X, Y and Z
95 | * components (see the section titled 'As Represented Textually') are all
96 | * packed into a 64-bit data structure.
97 | *
98 | * The low 32 bits represents the ID number for the account (the "account
99 | * number").
100 | * The next 20 bits represents the instance of the account. It is usually
101 | * set to 1 for user accounts.
102 | * The next 4 bits represents the type of account.
103 | * The next 8 bits represents the "Universe" the steam account belongs to.
104 | *
105 | * @param id64Bits The 64 bit Steam ID to parse.
106 | */
107 | public SteamId(long id64Bits) {
108 | this.id64Bits = id64Bits;
109 |
110 | accountNumber = (int) (id64Bits & 0xffffffff);
111 | accountInstance = (int) ((id64Bits >> 32) & 0xfffff);
112 | accountType = AccountType.fromInteger((int) ((id64Bits >> 52) & 0xf));
113 | accountUniverse = Universe.fromInteger((int) (id64Bits >> 56));
114 |
115 | textualId = createTextualId();
116 | }
117 |
118 | /**
119 | * Very loose way to generate a full Steam ID, uses a lot of assumptions.
120 | *
121 | * @param accountNumber The Stream account number to use.
122 | */
123 | public SteamId(int accountNumber) {
124 | this.accountNumber = accountNumber;
125 |
126 | // This is an educated guess, as found on:
127 | // http://dev.dota2.com/showthread.php?t=47115
128 | this.id64Bits = accountNumber + ACCOUNT_TO_ID_OFFSET;
129 |
130 | // Using assumed instance, type and universe.
131 | accountInstance = 1;
132 | accountType = AccountType.INDIVIDUAL;
133 | accountUniverse = Universe.PUBLIC;
134 |
135 | textualId = createTextualId();
136 | }
137 |
138 | /**
139 | * Creates a textual Steam ID.
140 | */
141 | private String createTextualId() {
142 | String textId = TEXTUAL_PREFIX;
143 | textId += accountUniverse.ordinal() + TEXTUAL_SEPARATOR;
144 | textId += accountNumber % 2 + TEXTUAL_SEPARATOR;
145 | textId += accountNumber / 2;
146 |
147 | return textId;
148 | }
149 |
150 | /**
151 | * Extracts the "Universe" from the textual Steam ID.
152 | *
153 | * @param textualId The Steam ID to parse.
154 | */
155 | private Universe getUniverseFromTextual(String textualId) {
156 | int universeOffset = TEXTUAL_PREFIX.length();
157 | String universeString = textualId.substring(universeOffset, universeOffset + 1);
158 | Universe universe = Universe.fromInteger(Integer.parseInt(universeString));
159 |
160 | return universe;
161 | }
162 |
163 | /**
164 | * Extracts the account number from the textual Steam ID.
165 | *
166 | * @param textualId The Steam ID to parse.
167 | */
168 | private int getAccountFromTextual(String textualId) {
169 | int account = 0;
170 | String[] splitted = textualId.split(TEXTUAL_SEPARATOR);
171 | int toAdd = Integer.parseInt(splitted[1]);
172 | int halfAccount = Integer.parseInt(splitted[2]);
173 |
174 | account = halfAccount * 2 + toAdd;
175 |
176 | return account;
177 | }
178 |
179 | /**
180 | * @return the textualId
181 | */
182 | public String getTextualId() {
183 | return textualId;
184 | }
185 |
186 | /**
187 | * @return the id64Bits
188 | */
189 | public long getId64Bits() {
190 | return id64Bits;
191 | }
192 |
193 | /**
194 | * @return the accountNumber
195 | */
196 | public int getAccountNumber() {
197 | return accountNumber;
198 | }
199 |
200 | /**
201 | * @return the accountInstance
202 | */
203 | public int getAccountInstance() {
204 | return accountInstance;
205 | }
206 |
207 | /**
208 | * @return the accountType
209 | */
210 | public AccountType getAccountType() {
211 | return accountType;
212 | }
213 |
214 | /**
215 | * @return the accountUniverse
216 | */
217 | public Universe getAccountUniverse() {
218 | return accountUniverse;
219 | }
220 | }
221 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/DotaRequest.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request;
2 |
3 | import java.util.Map;
4 |
5 | import nl.ansuz.android.steam.request.ISteamRequest;
6 | import nl.ansuz.android.steam.request.SteamRequest;
7 |
8 | /**
9 | * Abstract class to help creating Dota API requests.
10 | *
11 | * @author Wijnand
12 | * @see http://dev.dota2.com/showthread.php?t=47115
13 | */
14 | public abstract class DotaRequest extends SteamRequest implements ISteamRequest {
15 |
16 | /**
17 | * Simple list of the different Dota application IDs.
18 | *
19 | * @author Wijnand
20 | */
21 | public class ApplicationID {
22 | public final static int BETA = 205790;
23 | public final static int LIVE = 570;
24 | }
25 |
26 | private final static String INTERFACE_PREFIX = "IDOTA2Match_";
27 |
28 | /**
29 | * Builds the full interface name.
30 | *
31 | * @param applicationId The application to use this interface for.
32 | */
33 | protected String getInterface(int applicationId) {
34 | return INTERFACE_PREFIX + applicationId;
35 | }
36 |
37 | @Override
38 | protected String getBaseUrl(int appId) {
39 | String baseUrl = super.getBaseUrl(0);
40 | baseUrl += "/" + getInterface(appId);
41 |
42 | return baseUrl;
43 | }
44 |
45 | @Override
46 | public String createRequestUrl(int applicationId, Map params) {
47 | return serializeURL(getBaseUrl(applicationId), params);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/economy/GetHeroes.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request.economy;
2 |
3 | import nl.ansuz.android.steam.dota.request.DotaRequest;
4 | import nl.ansuz.android.steam.request.ISteamRequest;
5 |
6 | /**
7 | * Helps constructing the url to retreive an up to date Dota hero list.
8 | *
9 | * @author Wijnand
10 | */
11 | public class GetHeroes extends DotaRequest implements ISteamRequest {
12 |
13 | /**
14 | * Simple listing of available request parameters.
15 | */
16 | public class Parameter {
17 | /**
18 | * (Optional) (String) The ISO639-1 language code for the language to provide hero names in.
19 | */
20 | public final static String LANGUAGE = "language";
21 |
22 | /**
23 | *(Optional) (boolean) Return a list of itemized heroes only.
24 | */
25 | public final static String ITEMIZED_ONLY = "itemizedonly";
26 | }
27 |
28 | private final static String METHOD_NAME = "GetHeroes";
29 | private final static String INTERFACE_PREFIX = "IEconDOTA2_";
30 |
31 | @Override
32 | protected String getInterface(int applicationId) {
33 | return INTERFACE_PREFIX + applicationId;
34 | }
35 |
36 | @Override
37 | protected String getBaseUrl(int appId) {
38 | String baseUrl = super.getBaseUrl(appId);
39 | baseUrl += "/" + METHOD_NAME;
40 | baseUrl += "/" + API_VERSION_ONE;
41 | baseUrl += "/";
42 |
43 | return baseUrl;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/economy/GetRarities.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request.economy;
2 |
3 | import nl.ansuz.android.steam.dota.request.DotaRequest;
4 | import nl.ansuz.android.steam.request.ISteamRequest;
5 |
6 | /**
7 | * Helps constructing the url to retrieve the Dota 2 item rarity list.
8 | *
9 | * @see http://wiki.teamfortress.com/wiki/WebAPI/GetRarities
10 | * @author Wijnand Warren
11 | */
12 | public class GetRarities extends DotaRequest implements ISteamRequest {
13 |
14 | /**
15 | * Simple listing of available request parameters.
16 | */
17 | public class Parameter {
18 | /**
19 | * The language to provide rarity names in.
20 | */
21 | public final static String LANGUAGE = "language";
22 | }
23 |
24 | private final static String METHOD_NAME = "GetRarities";
25 | private final static String INTERFACE_PREFIX = "IEconDOTA2_";
26 |
27 | @Override
28 | protected String getInterface(int applicationId) {
29 | return INTERFACE_PREFIX + applicationId;
30 | }
31 |
32 | @Override
33 | protected String getBaseUrl(int appId) {
34 | String baseUrl = super.getBaseUrl(appId);
35 | baseUrl += "/" + METHOD_NAME;
36 | baseUrl += "/" + API_VERSION_ONE;
37 | baseUrl += "/";
38 |
39 | return baseUrl;
40 | }
41 | }
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/match/GetLeagueListing.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request.match;
2 |
3 | import nl.ansuz.android.steam.dota.request.DotaRequest;
4 | import nl.ansuz.android.steam.request.ISteamRequest;
5 |
6 | /**
7 | * Helps constructing the url to get information about DotaTV-supported leagues.
8 | *
9 | * @see http://wiki.teamfortress.com/wiki/WebAPI/GetLeagueListing
10 | * @author Wijnand
11 | */
12 | public class GetLeagueListing extends DotaRequest implements ISteamRequest {
13 |
14 | /**
15 | * Simple listing of available request parameters.
16 | */
17 | public class Parameter {
18 |
19 | /**
20 | * The ISO639-1 language code for the language all tokenized strings should be returned in.
21 | *
22 | * This is an optional parameter. If you omit it, all you get back in the name and description fields are the
23 | * tokens used to look up the translated strings. An example: "name": "#DOTA_Item_Killing_Spree_North_America".
24 | */
25 | public final static String LANGUAGE = "language";
26 |
27 | }
28 |
29 | public final static String METHOD_NAME = "GetLeagueListing";
30 |
31 | /** {@inheritDoc} */
32 | @Override
33 | protected String getBaseUrl(int appId) {
34 | String baseUrl = super.getBaseUrl(appId);
35 | baseUrl += "/" + METHOD_NAME;
36 | baseUrl += "/" + API_VERSION_ONE;
37 | baseUrl += "/";
38 |
39 | return baseUrl;
40 | }
41 | }
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/match/GetLiveLeagueGames.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request.match;
2 |
3 | import nl.ansuz.android.steam.dota.request.DotaRequest;
4 | import nl.ansuz.android.steam.request.ISteamRequest;
5 |
6 | /**
7 | * Helps constructing the url to get a list of league games in-progress.
8 | *
9 | * @see http://wiki.teamfortress.com/wiki/WebAPI/GetLiveLeagueGames
10 | * @author Wijnand
11 | */
12 | public class GetLiveLeagueGames extends DotaRequest implements ISteamRequest {
13 |
14 | public final static String METHOD_NAME = "GetLiveLeagueGames";
15 |
16 | /** {@inheritDoc} */
17 | @Override
18 | protected String getBaseUrl(int appId) {
19 | String baseUrl = super.getBaseUrl(appId);
20 | baseUrl += "/" + METHOD_NAME;
21 | baseUrl += "/" + API_VERSION_ONE;
22 | baseUrl += "/";
23 |
24 | return baseUrl;
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/match/GetMatchDetails.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request.match;
2 |
3 | import nl.ansuz.android.steam.dota.request.DotaRequest;
4 | import nl.ansuz.android.steam.request.ISteamRequest;
5 |
6 | /**
7 | * Helps constructing the url to retreive details of a Dota match.
8 | *
9 | * @see http://wiki.teamfortress.com/wiki/WebAPI/GetMatchDetails
10 | * @author Wijnand
11 | */
12 | public class GetMatchDetails extends DotaRequest implements ISteamRequest {
13 |
14 | /**
15 | * Simple listing of available request parameters.
16 | */
17 | public class Parameter {
18 |
19 | /**
20 | * The match's ID.
21 | */
22 | public final static String MATCH_ID = "match_id";
23 |
24 | }
25 |
26 | public final static String METHOD_NAME = "GetMatchDetails";
27 |
28 | /** {@inheritDoc} */
29 | @Override
30 | protected String getBaseUrl(int appId) {
31 | String baseUrl = super.getBaseUrl(appId);
32 | baseUrl += "/" + METHOD_NAME;
33 | baseUrl += "/" + API_VERSION_ONE;
34 | baseUrl += "/";
35 |
36 | return baseUrl;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/match/GetMatchHistory.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request.match;
2 |
3 | import nl.ansuz.android.steam.dota.request.DotaRequest;
4 | import nl.ansuz.android.steam.request.ISteamRequest;
5 |
6 | /**
7 | * Helps constructing the url to retrieve Dota match history.
8 | *
9 | * @author Wijnand
10 | */
11 | public class GetMatchHistory extends DotaRequest implements ISteamRequest {
12 |
13 | /**
14 | * Skill level, used to filter matches on.
15 | */
16 | public enum SkillLevel {
17 | ANY,
18 | NORMAL,
19 | HIGH,
20 | VERY_HIGH;
21 |
22 | /**
23 | * @param ordinal int - The {@link #ordinal()} value to get the {@link SkillLevel} for.
24 | * @return The {@link SkillLevel} based on the {@link #ordinal()} value.
25 | */
26 | public static SkillLevel fromInteger(int ordinal) {
27 | SkillLevel level = null;
28 |
29 | if (ordinal > -1 && ordinal < values().length) {
30 | level = values()[ordinal];
31 | }
32 |
33 | return level;
34 | }
35 | }
36 |
37 | /**
38 | * Simple listing of available request parameters.
39 | */
40 | public class Parameter {
41 |
42 | /**
43 | * Search matches with a player name, exact match only.
44 | */
45 | public final static String PLAYER_NAME = "player_name";
46 |
47 | /**
48 | * Search for matches with a specific hero being played.
49 | */
50 | public final static String HERO_ID = "hero_id";
51 |
52 | /**
53 | * Search for matches with a specific game mode.
54 | * @see GetMatchDetailsResponse#GameMode
55 | */
56 | public final static String GAME_MODE = "game_mode";
57 |
58 | /**
59 | * Skill bracket for the matches.
60 | * @see SkillLevel
61 | */
62 | public final static String SKILL = "skill";
63 |
64 | /**
65 | * Date in UTC seconds since Jan 1, 1970 (unix time format).
66 | */
67 | public final static String DATE_MIN = "date_min";
68 |
69 | /**
70 | * Date in UTC seconds since Jan 1, 1970 (unix time format).
71 | */
72 | public final static String DATE_MAX = "date_max";
73 |
74 | /**
75 | * Minimum amount of players in a match for the match to be returned.
76 | */
77 | public final static String MIN_PLAYERS = "min_players";
78 |
79 | /**
80 | * Steam account id (this is not SteamID, it's only the account number portion).
81 | */
82 | public final static String ACCOUNT_ID = "account_id";
83 |
84 | /**
85 | * Matches for a particular league.
86 | */
87 | public final static String LEAGUE_ID = "league_id";
88 |
89 | /**
90 | * Start the search at the indicated match id, descending.
91 | */
92 | public final static String START_AT_MATCH_ID = "start_at_match_id";
93 |
94 | /**
95 | * Amount of matches to include in results (default: 25).
96 | */
97 | public final static String MATCHES_REQUESTED = "matches_requested";
98 |
99 | /**
100 | * Whether to limit results to tournament matches.
101 | */
102 | public final static String TOURNAMENT_GAMES_ONLY = "tournament_games_only";
103 |
104 | }
105 |
106 | public final static String METHOD_NAME = "GetMatchHistory";
107 |
108 | @Override
109 | protected String getBaseUrl(int appId) {
110 | String baseUrl = super.getBaseUrl(appId);
111 | baseUrl += "/" + METHOD_NAME;
112 | baseUrl += "/" + API_VERSION_ONE;
113 | baseUrl += "/";
114 |
115 | return baseUrl;
116 | }
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/match/GetMatchHistoryBySequenceNum.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request.match;
2 |
3 | import nl.ansuz.android.steam.dota.request.DotaRequest;
4 | import nl.ansuz.android.steam.request.ISteamRequest;
5 |
6 | /**
7 | * Helps constructing the url to get a list of matches ordered by their sequence number.
8 | *
9 | * @see http://wiki.teamfortress.com/wiki/WebAPI/GetMatchHistoryBySequenceNum
10 | * @author Wijnand
11 | */
12 | public class GetMatchHistoryBySequenceNum extends DotaRequest implements ISteamRequest {
13 |
14 | /**
15 | * Simple listing of available request parameters.
16 | */
17 | public class Parameter {
18 | /**
19 | * The match sequence number to start returning results from.
20 | */
21 | public final static String START_AT_MATCH_SEQUENCE_NUMBER = "start_at_match_seq_num";
22 |
23 | /**
24 | * The amount of matches to return.
25 | */
26 | public final static String NUMBER_OF_MATCHES_REQUESTED = "matches_requested";
27 | }
28 |
29 | public final static String METHOD_NAME = "GetMatchHistoryBySequenceNum";
30 |
31 | /** {@inheritDoc} */
32 | @Override
33 | protected String getBaseUrl(int appId) {
34 | String baseUrl = super.getBaseUrl(appId);
35 | baseUrl += "/" + METHOD_NAME;
36 | baseUrl += "/" + API_VERSION_ONE;
37 | baseUrl += "/";
38 |
39 | return baseUrl;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/match/GetScheduledLeagueGames.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request.match;
2 |
3 | import nl.ansuz.android.steam.dota.request.DotaRequest;
4 | import nl.ansuz.android.steam.request.ISteamRequest;
5 |
6 | /**
7 | * Helps constructing the url to get a list of scheduled league games coming up.
8 | *
9 | * @see http://wiki.teamfortress.com/wiki/WebAPI/GetScheduledLeagueGames
10 | * @author Wijnand
11 | */
12 | public class GetScheduledLeagueGames extends DotaRequest implements ISteamRequest {
13 |
14 | /**
15 | * Simple listing of available request parameters.
16 | */
17 | public class Parameter {
18 |
19 | /**
20 | * long - (Optional) Minimum date (Unix timestamp) to get the league games for.
21 | */
22 | public final static String MINIMUM_DATE = "date_min";
23 |
24 | /**
25 | * long - (Optional) Maximum date (Unix timestamp) to get the league games for.
26 | */
27 | public final static String MAXIMUM_DATE = "date_max";
28 |
29 | }
30 |
31 | public final static String METHOD_NAME = "GetScheduledLeagueGames";
32 |
33 | /** {@inheritDoc} */
34 | @Override
35 | protected String getBaseUrl(int appId) {
36 | String baseUrl = super.getBaseUrl(appId);
37 | baseUrl += "/" + METHOD_NAME;
38 | baseUrl += "/" + API_VERSION_ONE;
39 | baseUrl += "/";
40 |
41 | return baseUrl;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/match/GetTeamInfoByTeamId.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request.match;
2 |
3 | import nl.ansuz.android.steam.dota.request.DotaRequest;
4 | import nl.ansuz.android.steam.request.ISteamRequest;
5 |
6 | /**
7 | * Helps constructing the url to get a list of all the teams set up in-game.
8 | *
9 | * @see http://wiki.teamfortress.com/wiki/WebAPI/GetTeamInfoByTeamID
10 | * @author Wijnand
11 | */
12 | public class GetTeamInfoByTeamId extends DotaRequest implements ISteamRequest {
13 |
14 | /**
15 | * Simple listing of available request parameters.
16 | */
17 | public class Parameter {
18 |
19 | /**
20 | * The team id to start returning results from.
21 | */
22 | public final static String START_AT_TEAM_ID = "start_at_team_id";
23 |
24 | /**
25 | * The amount of teams to return.
26 | */
27 | public final static String NUMBER_OF_TEAMS_REQUESTED = "teams_requested";
28 | }
29 |
30 | public final static String METHOD_NAME = "GetTeamInfoByTeamID";
31 |
32 | /** {@inheritDoc} */
33 | @Override
34 | protected String getBaseUrl(int appId) {
35 | String baseUrl = super.getBaseUrl(appId);
36 | baseUrl += "/" + METHOD_NAME;
37 | baseUrl += "/" + API_VERSION_ONE;
38 | baseUrl += "/";
39 |
40 | return baseUrl;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/request/match/GetTournamentPlayerStats.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.request.match;
2 |
3 | import nl.ansuz.android.steam.dota.request.DotaRequest;
4 | import nl.ansuz.android.steam.request.ISteamRequest;
5 |
6 | /**
7 | * Helps constructing the url to get stats about a particular player within a tournament.
8 | *
9 | * NOTE: When the API responds with:
10 | * "status": 8,
11 | * "statusDetail": "only supports tournament 65006"
12 | *
13 | * Try adding {@link Parameter#LEAGUE_ID} with value "65006" to the parameter {@link java.util.Map} when you call
14 | * {@link #createRequestUrl(int, java.util.Map)}.
15 | *
16 | * @see http://wiki.teamfortress.com/wiki/WebAPI/GetTournamentPlayerStats
17 | * @author Wijnand
18 | */
19 | public class GetTournamentPlayerStats extends DotaRequest implements ISteamRequest {
20 |
21 | /**
22 | * Simple listing of available request parameters.
23 | */
24 | public class Parameter {
25 |
26 | /**
27 | * String - 32-bit account ID.
28 | */
29 | public final static String ACCOUNT_ID = "account_id";
30 |
31 | /**
32 | * String - (Optional) A list of league IDs can be found via the {@link GetLeagueListing} method.
33 | */
34 | public final static String LEAGUE_ID = "league_id";
35 |
36 | /**
37 | * String - (Optional) A list of hero IDs can be found via the {@link GetHeroes} method.
38 | */
39 | public final static String HERO_ID = "hero_id";
40 |
41 | /**
42 | * String - (Optional) Only return stats between this time frame (parameter format not yet known).
43 | */
44 | public final static String TIME_FRAME = "time_frame";
45 |
46 | }
47 |
48 | public final static String METHOD_NAME = "GetTournamentPlayerStats";
49 |
50 | /** {@inheritDoc} */
51 | @Override
52 | protected String getBaseUrl(int appId) {
53 | String baseUrl = super.getBaseUrl(appId);
54 | baseUrl += "/" + METHOD_NAME;
55 | baseUrl += "/" + API_VERSION_ONE;
56 | baseUrl += "/";
57 |
58 | return baseUrl;
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/DotaResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Basic DotA API response.
7 | *
8 | * @author Wijnand
9 | */
10 | public class DotaResponse {
11 |
12 | /**
13 | * 1 - Success
14 | *
15 | * 8 - 'matches_requested' must be greater than 0. OR
16 | * 8 - 'teams_requested' must be greater than 0. OR
17 | * 8 - Only supports tournament 65006 (The International). (For {@link GetTournamentPlayerStats}.)
18 | *
19 | * 15 - Cannot get match history for a user that hasn't allowed it.
20 | */
21 | @SerializedName("status")
22 | public int status;
23 |
24 | /**
25 | * A message explaining the status, should status not be 1.
26 | */
27 | @SerializedName("statusDetail")
28 | public String statusDetail;
29 |
30 | }
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/economy/GetHeroesResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response.economy;
2 |
3 | import nl.ansuz.android.steam.dota.vo.HeroVO;
4 |
5 | import com.google.gson.annotations.SerializedName;
6 |
7 | /**
8 | * Response object for the GetHeroes request.
9 | *
10 | * @author Wijnand
11 | */
12 | public class GetHeroesResponse {
13 |
14 | /**
15 | * List of heroes.
16 | * If you want to sort this list, use the {@link HeroVoComparator}.
17 | */
18 | @SerializedName("heroes")
19 | public HeroVO[] heroes;
20 |
21 | /**
22 | * Total number of heroes.
23 | */
24 | @SerializedName("count")
25 | public int count;
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/economy/GetRaritiesResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 | import nl.ansuz.android.steam.dota.vo.RarityVO;
5 |
6 | /**
7 | * Response object for the GetRarities request.
8 | *
9 | * @author Wijnand Warren
10 | */
11 | public class GetRaritiesResponse {
12 |
13 | /**
14 | * Possible number of rarities. This number appears to be currently (as of 2012-08-19) incorrect and off by one.
15 | */
16 | @SerializedName("count")
17 | public int count;
18 |
19 | /**
20 | * List of rarity objects.
21 | */
22 | @SerializedName("rarities")
23 | public RarityVO[] rarities;
24 | }
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/match/GetLeagueListingResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response.match;
2 |
3 | import nl.ansuz.android.steam.dota.vo.LeagueVO;
4 |
5 | import com.google.gson.annotations.SerializedName;
6 |
7 | /**
8 | * Response object for the GetLeagueListing request.
9 | *
10 | * @author Wijnand
11 | */
12 | public class GetLeagueListingResponse {
13 |
14 | /**
15 | * A list of leagues supported in-game via DotaTV.
16 | */
17 | @SerializedName("leagues")
18 | public LeagueVO[] leagues;
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/match/GetLiveLeagueGamesResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response.match;
2 |
3 | import nl.ansuz.android.steam.dota.vo.match.LiveLeagueMatchVO;
4 |
5 | import com.google.gson.annotations.SerializedName;
6 |
7 | /**
8 | * Response object for the GetLiveLeagueGames request.
9 | *
10 | * @author Wijnand
11 | */
12 | public class GetLiveLeagueGamesResponse {
13 |
14 | /**
15 | * A list of games in-progress.
16 | */
17 | @SerializedName("games")
18 | public LiveLeagueMatchVO[] games;
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/match/GetMatchDetailsResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response.match;
2 |
3 | import nl.ansuz.android.steam.dota.util.DotaBuildingStatus.DotaTower;
4 | import nl.ansuz.android.steam.dota.vo.PickBanVO;
5 | import nl.ansuz.android.steam.dota.vo.PlayerVO;
6 |
7 | import com.google.gson.annotations.SerializedName;
8 | import nl.ansuz.android.steam.dota.vo.TeamMatchTotalsVO;
9 |
10 | /**
11 | * Response object for the GetMatchDetails request.
12 | *
13 | * @author Wijnand
14 | */
15 | public class GetMatchDetailsResponse {
16 |
17 | /**
18 | * Type of match lobby.
19 | *
20 | * @author Wijnand
21 | */
22 | public enum LobbyType {
23 | PUBLIC_MATCHMAKING,
24 | PRACTICE,
25 | TOURNAMENT,
26 | TUTORIAL,
27 | CO_OP_BOTS,
28 | TEAM_MATCH,
29 | SOLO_QUEUE;
30 |
31 | private static final LobbyType[] typeValues = LobbyType.values();
32 |
33 | public static LobbyType fromInteger(int i) {
34 | return typeValues[i];
35 | }
36 | }
37 |
38 | /**
39 | * Type of game mode.
40 | * The docs seem to be completely off here. What is listed on the site below, doesn't match with what I've seen in
41 | * testing.
42 | * Correct order is listed on:
43 | * https://bitbucket.org/VoiDeD/steamre/src/0152b728b88103ceb8afdaa8b157927135451d8d/Resources/Protobufs/dota/dota_gcmessages.proto
44 | * (DOTA_GameMode).
45 | *
46 | * @see http://wiki.teamfortress.com/wiki/WebAPI/GetMatchDetails
47 | * @author Wijnand
48 | */
49 | public enum GameMode {
50 | UNKNOWN,
51 | ALL_PICK,
52 | CAPTAINS_MODE,
53 | RANDOM_DRAFT,
54 | SINGLE_DRAFT,
55 | ALL_RANDOM,
56 | INTRO,
57 | DIRETIDE, // = Halloween
58 | REVERSE_CAPTAINS_MODE,
59 | THE_GREEVILING, // = Xmas
60 | TUTORIAL,
61 | MID_ONLY,
62 | LEAST_PLAYED,
63 | NEW_PLAYER_POOL,
64 | COMPENDIUM,
65 | CAPTAINS_DRAFT;
66 |
67 | private static final GameMode[] gameModeValues = GameMode.values();
68 |
69 | public static GameMode fromInteger(int i) {
70 | if(i < 1 || i > gameModeValues.length - 1) {
71 | i = 0;
72 | }
73 | return gameModeValues[i];
74 | }
75 | }
76 |
77 | private static final int ONE_MINUTE = 60;
78 |
79 | private TeamMatchTotalsVO radiantTotals = null;
80 | private TeamMatchTotalsVO direTotals = null;
81 |
82 | /**
83 | * The list of players that participated in this match.
84 | */
85 | @SerializedName("players")
86 | public PlayerVO[] players;
87 |
88 | /**
89 | * The season the game was played in.
90 | */
91 | @SerializedName("season")
92 | public int season;
93 |
94 | /**
95 | * True if radiant won, false otherwise.
96 | */
97 | @SerializedName("radiant_win")
98 | public boolean radiantWin;
99 |
100 | /**
101 | * Total time in seconds the match ran for.
102 | */
103 | @SerializedName("duration")
104 | public int duration;
105 |
106 | /**
107 | * Date in UTC seconds since Jan 1, 1970 (unix time format).
108 | */
109 | @SerializedName("start_time")
110 | public int startTime;
111 |
112 | /**
113 | * Numeric match ID.
114 | */
115 | @SerializedName("match_id")
116 | public long matchId;
117 |
118 | /**
119 | * A "sequence number", representing the order in which matches were recorded.
120 | */
121 | @SerializedName("match_seq_num")
122 | public long matchSequenceNumber;
123 |
124 | /**
125 | * An 11-bit unsinged int representing Radiant tower status.
126 | * Use in conjunction with {@link DotaBuildingStatus#isTowerUp(int, DotaTower)} to determine if the tower is still
127 | * up.
128 | *
129 | * @see http://dev.dota2.com/showthread.php?t=57234
130 | */
131 | @SerializedName("tower_status_radiant")
132 | public int towerStatusRadiant;
133 |
134 | /**
135 | * An 11-bit unsinged int representing Dire tower status.
136 | * Use in conjunction with {@link DotaBuildingStatus#isTowerUp(int, DotaTower)} to determine if the tower is still
137 | * up.
138 | *
139 | * @see http://dev.dota2.com/showthread.php?t=57234
140 | */
141 | @SerializedName("tower_status_dire")
142 | public int towerStatusDire;
143 |
144 | /**
145 | * A 6-bit unsinged int representing Radiant barracks status
146 | * Use in conjunction with {@link DotaBuildingStatus#isTowerUp(int, DotaBarracks)} to determine if the barracks are
147 | * still up.
148 | *
149 | * @see http://dev.dota2.com/showthread.php?t=57234
150 | */
151 | @SerializedName("barracks_status_radiant")
152 | public int barracksStatusRadiant;
153 |
154 | /**
155 | * A 6-bit unsinged int representing Dire barracks status
156 | * Use in conjunction with {@link DotaBuildingStatus#isTowerUp(int, DotaBarracks)} to determine if the barracks are
157 | * still up.
158 | *
159 | * @see http://dev.dota2.com/showthread.php?t=57234
160 | */
161 | @SerializedName("barracks_status_dire")
162 | public int barracksStatusDire;
163 |
164 | /**
165 | * The cluster this match was played at OR where to get the replay from.
166 | */
167 | @SerializedName("cluster")
168 | public int cluster;
169 |
170 | /**
171 | * Time in seconds at which first blood occurred
172 | */
173 | @SerializedName("first_blood_time")
174 | public int firstBloodTime;
175 |
176 | /**
177 | * Unique replay salt.
178 | */
179 | @SerializedName("replay_salt")
180 | public int replaySalt;
181 |
182 | /**
183 | * Type of lobby (0 for human matchmaking, 1 for co-op bot).
184 | */
185 | @SerializedName("lobby_type")
186 | public int lobbyType;
187 |
188 | /**
189 | * Number of human players in the match.
190 | */
191 | @SerializedName("human_players")
192 | public int humanPlayers;
193 |
194 | /**
195 | * League this match was played in.
196 | */
197 | @SerializedName("leagueid")
198 | public int leagueId;
199 |
200 | /**
201 | * number of thumbs up the game has received.
202 | */
203 | @SerializedName("positive_votes")
204 | public int positiveVotes;
205 |
206 | /**
207 | * Number of thumbs down the game has received.
208 | */
209 | @SerializedName("negative_votes")
210 | public int negativeVotes;
211 |
212 | /**
213 | * The type of game that was played.
214 | */
215 | @SerializedName("game_mode")
216 | public int gameMode;
217 |
218 | /**
219 | * A list of the picks and bans in the match, if the game mode is Captains Mode.
220 | */
221 | @SerializedName("picks_bans")
222 | public PickBanVO[] picksBans;
223 |
224 | /**
225 | * Radiant's league team unique ID.
226 | * Use {@link GetTeamInfoByTeamId} to retrieve full team details.
227 | */
228 | @SerializedName("radiant_team_id")
229 | public int radiantTeamId;
230 |
231 | /**
232 | * Radiant's league team name.
233 | */
234 | @SerializedName("radiant_name")
235 | public String radiantTeamName;
236 |
237 | /**
238 | * Radiant's league team logo UGC id.
239 | * Use {@link GetUGCFileDetails} to retrieve file details.
240 | */
241 | @SerializedName("radiant_logo")
242 | public long radiantTeamLogo;
243 |
244 | /**
245 | * Whether the players for the Radiant league team are all team members.
246 | */
247 | @SerializedName("radiant_team_complete")
248 | public int radiantTeamComplete;
249 |
250 | /**
251 | * Radiant's league team unique ID.
252 | * Use {@link GetTeamInfoByTeamId} to retrieve full team details.
253 | */
254 | @SerializedName("dire_team_id")
255 | public int direTeamId;
256 |
257 | /**
258 | * Radiant's league team name.
259 | */
260 | @SerializedName("dire_name")
261 | public String direTeamName;
262 |
263 | /**
264 | * Radiant's league team logo UGC id.
265 | * Use {@link GetUGCFileDetails} to retrieve file details.
266 | */
267 | @SerializedName("dire_logo")
268 | public long direTeamLogo;
269 |
270 | /**
271 | * Whether the players for the Radiant league team are all team members.
272 | */
273 | @SerializedName("dire_team_complete")
274 | public int direTeamComplete;
275 |
276 | /**
277 | * Calculates the total Gold, XP, kills, deaths, assists by Radiant and Dire.
278 | */
279 | private void calculateTotals() {
280 | // Only calculate total when we haven't done so yet.
281 | if (radiantTotals == null) {
282 | radiantTotals = new TeamMatchTotalsVO();
283 | direTotals = new TeamMatchTotalsVO();
284 |
285 | for (PlayerVO player : players) {
286 | if (player.isRadiant()) {
287 | radiantTotals.totalGold += player.getTotalGold();
288 | radiantTotals.totalXp += player.xpPerMinute * duration / ONE_MINUTE;
289 | radiantTotals.totalKills += player.kills;
290 | radiantTotals.totalDeaths += player.deaths;
291 | radiantTotals.totalAssists += player.assists;
292 | } else {
293 | direTotals.totalGold += player.getTotalGold();
294 | direTotals.totalXp += player.xpPerMinute * duration / ONE_MINUTE;
295 | direTotals.totalKills += player.kills;
296 | direTotals.totalDeaths += player.deaths;
297 | direTotals.totalAssists += player.assists;
298 | }
299 | }
300 | }
301 | }
302 |
303 | /**
304 | * @return The team total scores for the Radiant.
305 | */
306 | public TeamMatchTotalsVO getTotalsRadiant() {
307 | calculateTotals();
308 | return radiantTotals;
309 | }
310 |
311 | /**
312 | * @return The team total scores for the Dire.
313 | */
314 | public TeamMatchTotalsVO getTotalsDire() {
315 | calculateTotals();
316 | return direTotals;
317 | }
318 |
319 | /**
320 | * @return Whether the players for the Radiant team are all team members.
321 | */
322 | public boolean isRadiantTeamComplete() {
323 | return radiantTeamComplete > 0;
324 | }
325 |
326 | /**
327 | * @return Whether the players for the Dire team are all team members.
328 | */
329 | public boolean isDireTeamComplete() {
330 | return radiantTeamComplete > 0;
331 | }
332 | }
333 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/match/GetMatchHistoryBySequenceNumResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response.match;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 | import nl.ansuz.android.steam.dota.response.DotaResponse;
5 |
6 | /**
7 | * Response object for the GetMatchHistoryBySequenceNum request.
8 | *
9 | * @author Wijnand
10 | */
11 | public class GetMatchHistoryBySequenceNumResponse extends DotaResponse {
12 |
13 | @SerializedName("matches")
14 | public GetMatchDetailsResponse[] matches;
15 |
16 | }
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/match/GetMatchHistoryResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response.match;
2 |
3 | import nl.ansuz.android.steam.dota.response.DotaResponse;
4 | import nl.ansuz.android.steam.dota.vo.MatchVO;
5 |
6 | import com.google.gson.annotations.SerializedName;
7 |
8 | /**
9 | * Response object for the GetMatchHistory request.
10 | *
11 | * @author Wijnand
12 | */
13 | public class GetMatchHistoryResponse extends DotaResponse {
14 |
15 | @SerializedName("num_results")
16 | public int numberOfResults;
17 |
18 | @SerializedName("total_results")
19 | public int totalResults;
20 |
21 | @SerializedName("results_remaining")
22 | public int resultsRemaining;
23 |
24 | @SerializedName("matches")
25 | public MatchVO[] matches;
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/match/GetScheduledLeagueGamesResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response.match;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 | import nl.ansuz.android.steam.dota.vo.match.ScheduledLeagueMatchVO;
5 |
6 | /**
7 | * Response object for the GetScheduledLeagueGames API request.
8 | *
9 | * @author Wijnand
10 | */
11 | public class GetScheduledLeagueGamesResponse {
12 |
13 | @SerializedName("games")
14 | public ScheduledLeagueMatchVO[] games;
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/match/GetTeamInfoByTeamIdResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response.match;
2 |
3 | import nl.ansuz.android.steam.dota.response.DotaResponse;
4 | import nl.ansuz.android.steam.dota.vo.TeamDetailsVO;
5 |
6 | import com.google.gson.annotations.SerializedName;
7 |
8 | /**
9 | * Response object for the GetTeamInfoByTeamId API request.
10 | *
11 | * @author Wijnand
12 | */
13 | public class GetTeamInfoByTeamIdResponse extends DotaResponse {
14 |
15 | /**
16 | * A list of leagues supported in-game via DotaTV.
17 | */
18 | @SerializedName("teams")
19 | public TeamDetailsVO[] teams;
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/response/match/GetTournamentPlayerStatsResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.response.match;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 | import nl.ansuz.android.steam.dota.response.DotaResponse;
5 |
6 | /**
7 | * Response object for the GetTournamentPlayerStats API request.
8 | *
9 | * @author Wijnand
10 | */
11 | public class GetTournamentPlayerStatsResponse extends DotaResponse {
12 |
13 | /**
14 | * Number of matches returned.
15 | */
16 | @SerializedName("num_results")
17 | public int numberOfResults;
18 |
19 | /**
20 | * An array of matches.
21 | * (Object structure not yet known.)
22 | */
23 | @SerializedName("matches")
24 | public String[] matches;
25 |
26 | /**
27 | * Total wins.
28 | */
29 | @SerializedName("wins")
30 | public int winsTotal;
31 |
32 | /**
33 | * Total losses.
34 | */
35 | @SerializedName("losses")
36 | public int lossesTotal;
37 |
38 | /**
39 | * Total kills.
40 | */
41 | @SerializedName("kills")
42 | public int killsTotal;
43 |
44 | /**
45 | * Total deaths.
46 | */
47 | @SerializedName("deaths")
48 | public int deathsTotal;
49 |
50 | /**
51 | * Total assists.
52 | */
53 | @SerializedName("assists")
54 | public int assistsTotal;
55 |
56 | /**
57 | * Average number of kills per match.
58 | */
59 | @SerializedName("kills_average")
60 | public double killsAverage;
61 |
62 | /**
63 | * Average number of deaths per match.
64 | */
65 | @SerializedName("deaths_average")
66 | public double deathsAverage;
67 |
68 | /**
69 | * Average number of deaths per match.
70 | */
71 | @SerializedName("assists_average")
72 | public double assistsAverage;
73 |
74 | /**
75 | * Average gold per minute.
76 | */
77 | @SerializedName("gpm_average")
78 | public double goldPerMinuteAverage;
79 |
80 | /**
81 | * Average XP per minute.
82 | */
83 | @SerializedName("xpm_average")
84 | public double experiencePerMinuteAverage;
85 |
86 | /**
87 | * Best total kills in a match.
88 | */
89 | @SerializedName("best_kills")
90 | public int killTotalBest;
91 |
92 | /**
93 | * Which Hero the player was playing when they achieved {@link #killTotalBest}.
94 | * A list of hero IDs can be found via the {@link GetHeroes} method.
95 | */
96 | @SerializedName("best_kills_heroid")
97 | public int killTotalBestHero;
98 |
99 | /**
100 | * Best gold per minute in a match.
101 | */
102 | @SerializedName("best_gpm")
103 | public int goldPerMinuteBest;
104 |
105 | /**
106 | * Which Hero the player was playing when they achieved {@link #goldPerMinuteBest}.
107 | * A list of hero IDs can be found via the {@link GetHeroes} method.
108 | */
109 | @SerializedName("best_gpm_heroid")
110 | public int goldPerMinuteBestHero;
111 |
112 | /**
113 | * An array of heroes played.
114 | * (Object structure not yet known.)
115 | */
116 | @SerializedName("heroes_played")
117 | public String[] heroesPlayed;
118 |
119 | }
120 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/util/DotaBuildingStatus.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.util;
2 |
3 | /**
4 | * Util class to check DotA match building status.
5 | *
6 | * @author Wijnand
7 | */
8 | public class DotaBuildingStatus {
9 |
10 | /**
11 | * DotA towers and their numeric representations.
12 | *
13 | * @author Wijnand
14 | */
15 | public enum DotaTower {
16 | TIER_1_BOTTOM (1),
17 | TIER_2_BOTTOM (2),
18 | TIER_3_BOTTOM (4),
19 | TIER_1_MIDDLE (8),
20 | TIER_2_MIDDLE (16),
21 | TIER_3_MIDDLE (32),
22 | TIER_1_TOP (64),
23 | TIER_2_TOP (128),
24 | TIER_3_TOP (256),
25 | ANCIENT_BOTTOM (512),
26 | ANCIENT_TOP (1024);
27 |
28 | private final int towerValue;
29 |
30 | DotaTower(int value) {
31 | towerValue = value;
32 | }
33 | }
34 |
35 | /**
36 | * DotA barracks and their numeric representations.
37 | *
38 | * @author Wijnand
39 | */
40 | public enum DotaBarracks {
41 | MELEE_BOTTOM (1),
42 | RANGED_BOTTOM (2),
43 | MELEE_MIDDLE (4),
44 | RANGED_MIDDLE (8),
45 | MELEE_TOP (16),
46 | RANGED_TOP (32);
47 |
48 | private final int barracksValue;
49 |
50 | DotaBarracks(int value) {
51 | barracksValue = value;
52 | }
53 | }
54 |
55 | /**
56 | * Determines whether or not a tower in a base is still up.
57 | *
58 | * @param towerStatus The tower status as received in the
59 | * GetMatchDetailsResponse class.
60 | * @param tower The tower to check.
61 | */
62 | public Boolean isTowerUp(int towerStatus, DotaTower tower) {
63 | return (towerStatus & tower.towerValue) == tower.towerValue;
64 | }
65 |
66 | /**
67 | * Determines whether or not a barracks in a base is still up.
68 | *
69 | * @param towerStatus The barracks status as received in the
70 | * GetMatchDetailsResponse class.
71 | * @param tower The barracks to check.
72 | */
73 | public Boolean isBarracksUp(int barracksStatus, DotaBarracks barracks) {
74 | return (barracksStatus & barracks.barracksValue) == barracks.barracksValue;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/util/DotaReplayUrlBuilder.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.util;
2 |
3 | /**
4 | * Util class to construct DotA match replay URLs.
5 | *
6 | * @author Wijnand
7 | */
8 | public class DotaReplayUrlBuilder {
9 |
10 | /**
11 | * Constructs a DotA replay URL.
12 | * All this data can be obtained from the GetMatchDetailsResponse class.
13 | *
14 | * @param cluster The replay cluster to use.
15 | * @param appId The application id.
16 | * @param matchId The match id.
17 | * @param replaySalt Unique replay salt.
18 | */
19 | public String getReplayUrl(int cluster, int appId, int matchId, int replaySalt) {
20 | String replayUrl = "http://replay" + cluster;
21 | replayUrl += ".valve.net/" + appId;
22 | replayUrl += "/" + matchId;
23 | replayUrl += "_" + replaySalt;
24 | replayUrl += ".dem.bz2";
25 |
26 | return replayUrl;
27 | }
28 |
29 | /**
30 | * Constructs a DotA replay URL using the dota2 protocol.
31 | *
32 | * @param matchId The match to get the replay for.
33 | * @param startTime Point in time to start the replay at.
34 | */
35 | public String getShortReplayUrl(int matchId, int startTime) {
36 | String replayUrl = "dota2://matchid=" + matchId;
37 | replayUrl += "&matchtime=" + startTime;
38 |
39 | return replayUrl;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/util/HeroBuildItemList.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.util;
2 |
3 | import nl.ansuz.android.steam.dota.vo.BuildItemVO;
4 | import nl.ansuz.android.steam.dota.vo.heroes.AbilityVO;
5 |
6 | /**
7 | * Auto-generated Hero build item list.
8 | *
9 | * This class gets generated by passing the DotA game file
10 | * "scripts/npc/items.txt" that can be extracted from
11 | * "/Steam/steamapps/common/dota 2 beta/dota/pak01_dir.vpk"
12 | *
13 | * Use tools/itemparser/BuildItemsParser.py to generate.
14 | *
15 | * @author Wijnand
16 | */
17 | public class HeroBuildItemList {
18 |
19 | private BuildItemVO[] itemList;
20 |
21 | /**
22 | * CONSTRUCTOR
23 | */
24 | public HeroBuildItemList() {
25 | init();
26 | }
27 |
28 | /**
29 | * Initializes this class.
30 | */
31 | private void init() {
32 | createItemList();
33 | }
34 |
35 | /**
36 | * Constructs the Hero build item list.
37 | */
38 | private void createItemList() {
39 | itemList = new BuildItemVO[241];
40 | itemList[1] = new BuildItemVO(1, "Blink dagger", "item_blink", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DIRECTIONAL.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_ROOT_DISABLES.behaviourValue, new int[]{0}, 0.0, new double[]{12.0}, new int[]{75}, 2150, new String[]{"teleport"}, "component", true, new String[]{"npc_dota_hero_vengefulspirit", "npc_dota_hero_pudge"});
41 | itemList[2] = new BuildItemVO(2, "Blades of Attack", "item_blades_of_attack", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 450, new String[]{"damage", "tutorial"}, "component", true, null);
42 | itemList[3] = new BuildItemVO(3, "Broadsword", "item_broadsword", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1200, new String[]{"damage"}, "component", false, null);
43 | itemList[4] = new BuildItemVO(4, "Chainmail", "item_chainmail", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 550, new String[]{"armor"}, "component", true, null);
44 | itemList[5] = new BuildItemVO(5, "Claymore", "item_claymore", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1400, new String[]{"damage"}, "component", false, null);
45 | itemList[6] = new BuildItemVO(6, "Helm of Iron Will", "item_helm_of_iron_will", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 950, new String[]{"armor", "regen_health"}, "component", true, null);
46 | itemList[7] = new BuildItemVO(7, "Javelin", "item_javelin", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1500, new String[]{"damage"}, "component", false, null);
47 | itemList[8] = new BuildItemVO(8, "Mithril Hammer", "item_mithril_hammer", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1600, new String[]{"damage"}, "component", false, null);
48 | itemList[9] = new BuildItemVO(9, "Platemail", "item_platemail", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1400, new String[]{"armor"}, "component", false, null);
49 | itemList[10] = new BuildItemVO(10, "Quarterstaff", "item_quarterstaff", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 900, new String[]{"damage", "attack_speed"}, "component", true, null);
50 | itemList[11] = new BuildItemVO(11, "Quelling Blade", "item_quelling_blade", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{350}, 0.0, new double[]{5.0}, new int[]{0}, 225, new String[]{"damage"}, "component", true, null);
51 | itemList[12] = new BuildItemVO(12, "Ring of Protection", "item_ring_of_protection", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 175, new String[]{"armor"}, "component", false, null);
52 | itemList[182] = new BuildItemVO(182, "Stout Shield", "item_stout_shield", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 250, new String[]{"block"}, "component", true, null);
53 | itemList[13] = new BuildItemVO(13, "Gauntlets", "item_gauntlets", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 150, new String[]{"str"}, "component", false, null);
54 | itemList[14] = new BuildItemVO(14, "Slippers", "item_slippers", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 150, new String[]{"agi"}, "component", true, null);
55 | itemList[15] = new BuildItemVO(15, "Mantle", "item_mantle", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 150, new String[]{"int"}, "component", false, null);
56 | itemList[16] = new BuildItemVO(16, "Branches", "item_branches", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 53, new String[]{"agi", "int", "str"}, "component", false, null);
57 | itemList[17] = new BuildItemVO(17, "Belt of Strength", "item_belt_of_strength", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 450, new String[]{"str"}, "component", true, null);
58 | itemList[18] = new BuildItemVO(18, "Boots of Elves", "item_boots_of_elves", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 450, new String[]{"agi"}, "component", true, null);
59 | itemList[19] = new BuildItemVO(19, "Robe", "item_robe", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 450, new String[]{"int"}, "component", true, null);
60 | itemList[20] = new BuildItemVO(20, "Circlet", "item_circlet", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 185, new String[]{"agi", "int", "str"}, "component", false, null);
61 | itemList[21] = new BuildItemVO(21, "Ogre Axe", "item_ogre_axe", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1000, new String[]{"str"}, "component", false, null);
62 | itemList[22] = new BuildItemVO(22, "Blade of Alacrity", "item_blade_of_alacrity", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1000, new String[]{"agi"}, "component", false, null);
63 | itemList[23] = new BuildItemVO(23, "Staff of Wizardry", "item_staff_of_wizardry", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1000, new String[]{"int"}, "component", false, null);
64 | itemList[24] = new BuildItemVO(24, "Ultimate Orb", "item_ultimate_orb", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2100, new String[]{"agi", "int", "str"}, "component", true, null);
65 | itemList[25] = new BuildItemVO(25, "Gloves", "item_gloves", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 500, new String[]{"attack_speed"}, "component", true, null);
66 | itemList[26] = new BuildItemVO(26, "Lifesteal", "item_lifesteal", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 900, new String[]{"unique"}, "component", true, null);
67 | itemList[27] = new BuildItemVO(27, "Ring of Regen", "item_ring_of_regen", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 350, new String[]{"regen_health"}, "component", true, null);
68 | itemList[28] = new BuildItemVO(28, "Sobi Mask", "item_sobi_mask", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 325, new String[]{"regen_mana"}, "component", true, null);
69 | itemList[29] = new BuildItemVO(29, "Boots", "item_boots", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 450, new String[]{"move_speed"}, "component", true, null);
70 | itemList[30] = new BuildItemVO(30, "Gem", "item_gem", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 850, new String[]{"see_invis"}, "component", false, null);
71 | itemList[31] = new BuildItemVO(31, "Cloak", "item_cloak", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 550, new String[]{"magic_resist"}, "component", true, null);
72 | itemList[32] = new BuildItemVO(32, "Talisman of Evasion", "item_talisman_of_evasion", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1800, new String[]{"evasion"}, "component", true, null);
73 | itemList[33] = new BuildItemVO(33, "Cheese", "item_cheese", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{40.0}, null, 1000, null, "epic", false, null);
74 | itemList[34] = new BuildItemVO(34, "Magic Stick", "item_magic_stick", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{13.0}, null, 200, new String[]{"regen_health", "regen_mana", "boost_health", "boost_mana"}, "component", true, null);
75 | itemList[35] = new BuildItemVO(35, "Recipe: Magic Wand", "item_recipe_magic_wand", -1, null, -1, null, null, 150, null, "", false, null);
76 | itemList[36] = new BuildItemVO(36, "Magic Wand", "item_magic_wand", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{13.0}, null, 509, new String[]{"regen_health", "regen_mana", "boost_health", "boost_mana", "int", "agi", "str"}, "common", false, null);
77 | itemList[37] = new BuildItemVO(37, "Ghost", "item_ghost", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue, null, -1, new double[]{30.0}, null, 1600, new String[]{"int", "agi", "str", "hard_to_tag"}, "component", false, null);
78 | itemList[38] = new BuildItemVO(38, "Clarity", "item_clarity", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{100}, 0.0, null, null, 50, new String[]{"consumable"}, "consumable", false, null);
79 | itemList[39] = new BuildItemVO(39, "Flask", "item_flask", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{100}, 0.0, null, null, 100, new String[]{"consumable"}, "consumable", false, null);
80 | itemList[40] = new BuildItemVO(40, "Dust", "item_dust", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{60.0}, new int[]{5}, 180, new String[]{"consumable"}, "consumable", false, null);
81 | itemList[41] = new BuildItemVO(41, "Bottle", "item_bottle", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{0.5}, null, 600, new String[]{"consumable"}, "consumable", false, null);
82 | itemList[42] = new BuildItemVO(42, "Observer Wards", "item_ward_observer", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue, new int[]{500}, 0.0, new double[]{1.0}, null, 150, new String[]{"consumable"}, "consumable", false, null);
83 | itemList[43] = new BuildItemVO(43, "Sentry Ward", "item_ward_sentry", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue, new int[]{500}, 0.0, new double[]{1.0}, null, 200, new String[]{"consumable"}, "consumable", false, null);
84 | itemList[44] = new BuildItemVO(44, "Tango", "item_tango", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{165}, 0.0, null, null, 90, new String[]{"consumable"}, "consumable", false, null);
85 | itemList[45] = new BuildItemVO(45, "Courier", "item_courier", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, null, null, 150, new String[]{"consumable"}, "consumable", false, null);
86 | itemList[46] = new BuildItemVO(46, "Teleport Scroll", "item_tpscroll", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_CHANNELLED.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NOASSIST.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{0}, 0.0, new double[]{65.0}, new int[]{75}, 135, new String[]{"consumable", "tutorial"}, "consumable", true, null);
87 | itemList[47] = new BuildItemVO(47, "Recipe: Travel Boots", "item_recipe_travel_boots", -1, null, -1, null, null, 2000, null, "", false, null);
88 | itemList[48] = new BuildItemVO(48, "Travel Boots", "item_travel_boots", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_CHANNELLED.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, null, -1, new double[]{60.0}, new int[]{75}, 2450, new String[]{"teleport", "move_speed"}, "common", false, null);
89 | itemList[49] = new BuildItemVO(49, "Recipe: Phase Boots", "item_recipe_phase_boots", -1, null, -1, null, null, 0, null, "", false, null);
90 | itemList[50] = new BuildItemVO(50, "Phase Boots", "item_phase_boots", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IGNORE_CHANNEL.behaviourValue, null, -1, new double[]{8.0}, null, 1350, new String[]{"damage", "move_speed", "hard_to_tag"}, "common", false, null);
91 | itemList[51] = new BuildItemVO(51, "Demon Edge", "item_demon_edge", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2400, new String[]{"damage"}, "secret_shop", false, null);
92 | itemList[52] = new BuildItemVO(52, "Eagle Horn", "item_eagle", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 3300, new String[]{"agi"}, "secret_shop", false, null);
93 | itemList[53] = new BuildItemVO(53, "Reaver", "item_reaver", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 3200, new String[]{"str"}, "secret_shop", false, null);
94 | itemList[54] = new BuildItemVO(54, "Sacred Relic", "item_relic", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 3800, new String[]{"damage"}, "secret_shop", false, null);
95 | itemList[55] = new BuildItemVO(55, "Hyperstone", "item_hyperstone", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2100, new String[]{"attack_speed"}, "secret_shop", false, null);
96 | itemList[56] = new BuildItemVO(56, "Ring of Health", "item_ring_of_health", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 875, new String[]{"regen_health"}, "secret_shop", true, null);
97 | itemList[57] = new BuildItemVO(57, "Void Stone", "item_void_stone", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 875, new String[]{"regen_mana"}, "secret_shop", false, null);
98 | itemList[58] = new BuildItemVO(58, "Mystic Staff", "item_mystic_staff", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2700, new String[]{"int"}, "secret_shop", false, null);
99 | itemList[59] = new BuildItemVO(59, "Energy Booster", "item_energy_booster", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1000, new String[]{"mana_pool"}, "secret_shop", true, null);
100 | itemList[60] = new BuildItemVO(60, "Point Booster", "item_point_booster", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1200, new String[]{"mana_pool", "health_pool"}, "secret_shop", false, null);
101 | itemList[61] = new BuildItemVO(61, "Vitality Booster", "item_vitality_booster", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1100, new String[]{"health_pool"}, "secret_shop", false, null);
102 | itemList[62] = new BuildItemVO(62, "Recipe: Power Treads", "item_recipe_power_treads", -1, null, -1, null, null, 0, null, "", false, null);
103 | itemList[63] = new BuildItemVO(63, "Power Treads", "item_power_treads", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, null, null, 1400, new String[]{"attack_speed", "move_speed", "int", "agi", "str"}, "common", false, null);
104 | itemList[64] = new BuildItemVO(64, "Recipe: Hand of Midas", "item_recipe_hand_of_midas", -1, null, -1, null, null, 1400, null, "", false, null);
105 | itemList[65] = new BuildItemVO(65, "Hand of Midas", "item_hand_of_midas", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{600}, 0.0, new double[]{100.0}, new int[]{0}, 1900, new String[]{"attack_speed", "hard_to_tag"}, "common", false, null);
106 | itemList[66] = new BuildItemVO(66, "Recipe: Oblivion Staff", "item_recipe_oblivion_staff", -1, null, -1, null, null, 0, null, "", false, null);
107 | itemList[67] = new BuildItemVO(67, "Oblivion Staff", "item_oblivion_staff", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1675, new String[]{"damage", "int", "attack_speed", "regen_mana"}, "common", false, null);
108 | itemList[68] = new BuildItemVO(68, "Recipe: Perseverence", "item_recipe_pers", -1, null, -1, null, null, 0, null, "", false, null);
109 | itemList[69] = new BuildItemVO(69, "Perseverence", "item_pers", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 1750, new String[]{"damage", "regen_health", "regen_mana"}, "common", false, null);
110 | itemList[70] = new BuildItemVO(70, "Recipe: Poor Man's Shield", "item_recipe_poor_mans_shield", -1, null, -1, null, null, 0, null, "", false, null);
111 | itemList[71] = new BuildItemVO(71, "Poor Man's Shield", "item_poor_mans_shield", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 550, new String[]{"agi", "block"}, "common", false, null);
112 | itemList[72] = new BuildItemVO(72, "Recipe: Bracer", "item_recipe_bracer", -1, null, -1, null, null, 190, null, "", false, null);
113 | itemList[73] = new BuildItemVO(73, "Bracer", "item_bracer", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 525, new String[]{"damage", "int", "agi", "str"}, "common", false, null);
114 | itemList[74] = new BuildItemVO(74, "Recipe: Wraith Band", "item_recipe_wraith_band", -1, null, -1, null, null, 150, null, "", false, null);
115 | itemList[75] = new BuildItemVO(75, "Wraith Band", "item_wraith_band", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 485, new String[]{"damage", "int", "agi", "str"}, "common", false, null);
116 | itemList[76] = new BuildItemVO(76, "Recipe: Null Talisman", "item_recipe_null_talisman", -1, null, -1, null, null, 135, null, "", false, null);
117 | itemList[77] = new BuildItemVO(77, "Null Talisman", "item_null_talisman", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 470, new String[]{"damage", "int", "agi", "str"}, "common", false, null);
118 | itemList[78] = new BuildItemVO(78, "Recipe: Mekasmm", "item_recipe_mekansm", -1, null, -1, null, null, 900, null, "", false, null);
119 | itemList[79] = new BuildItemVO(79, "Mekansm", "item_mekansm", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{45.0}, new int[]{150}, 2306, new String[]{"agi", "int", "str", "armor", "boost_health"}, "rare", false, null);
120 | itemList[80] = new BuildItemVO(80, "Recipe: Vladimir", "item_recipe_vladmir", -1, null, -1, null, null, 300, null, "", false, null);
121 | itemList[81] = new BuildItemVO(81, "Vladimir", "item_vladmir", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2050, new String[]{"lifesteal", "damage", "armor", "regen_mana"}, "rare", false, null);
122 | itemList[84] = new BuildItemVO(84, "Flying Courier", "item_flying_courier", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 220, new String[]{"consumable"}, "consumable", false, null);
123 | itemList[85] = new BuildItemVO(85, "Recipe: Buckler", "item_recipe_buckler", -1, null, -1, null, null, 200, null, "", false, null);
124 | itemList[86] = new BuildItemVO(86, "Buckler", "item_buckler", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{25.0}, new int[]{10}, 803, new String[]{"armor", "boost_armor"}, "rare", false, null);
125 | itemList[87] = new BuildItemVO(87, "Recipe: Ring of Basilius", "item_recipe_ring_of_basilius", -1, null, -1, null, null, 0, null, "", false, null);
126 | itemList[88] = new BuildItemVO(88, "Ring of Basilius", "item_ring_of_basilius", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_TOGGLE.behaviourValue, null, -1, null, null, 500, new String[]{"damage", "regen_mana", "armor"}, "rare", false, null);
127 | itemList[89] = new BuildItemVO(89, "Recipe: Pipe", "item_recipe_pipe", -1, null, -1, null, null, 900, null, "", false, null);
128 | itemList[90] = new BuildItemVO(90, "Pipe", "item_pipe", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{60.0}, new int[]{100}, 3628, new String[]{"regen_health", "boost_magic_resist"}, "rare", false, null);
129 | itemList[91] = new BuildItemVO(91, "Recipe: Urn of Shadows", "item_recipe_urn_of_shadows", -1, null, -1, null, null, 250, null, "", false, null);
130 | itemList[92] = new BuildItemVO(92, "Urn of Shadows", "item_urn_of_shadows", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{950}, 0.0, new double[]{10.0}, null, 875, new String[]{"regen_mana", "str", "boost_health"}, "rare", false, null);
131 | itemList[93] = new BuildItemVO(93, "Recipe: Headdress", "item_recipe_headdress", -1, null, -1, null, null, 200, null, "", false, null);
132 | itemList[94] = new BuildItemVO(94, "Headdress", "item_headdress", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 603, new String[]{"str", "int", "agi", "regen_health"}, "rare", false, null);
133 | itemList[95] = new BuildItemVO(95, "Recipe: Sheepstick", "item_recipe_sheepstick", -1, null, -1, null, null, 0, null, "", false, null);
134 | itemList[96] = new BuildItemVO(96, "Sheepstick", "item_sheepstick", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{800}, 0.0, new double[]{35.0}, new int[]{100}, 5675, new String[]{"int", "regen_mana", "agi", "hard_to_tag"}, "rare", false, null);
135 | itemList[97] = new BuildItemVO(97, "Recipe: Orchid", "item_recipe_orchid", -1, null, -1, null, null, 775, null, "", false, null);
136 | itemList[98] = new BuildItemVO(98, "Orchid", "item_orchid", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{900}, 0.0, new double[]{18.0}, new int[]{100}, 5025, new String[]{"int", "attack_speed", "damage", "regen_mana", "damage", "hard_to_tag"}, "rare", false, null);
137 | itemList[99] = new BuildItemVO(99, "Recipe: Cyclone", "item_recipe_cyclone", -1, null, -1, null, null, 500, null, "", false, null);
138 | itemList[100] = new BuildItemVO(100, "Cyclone", "item_cyclone", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{700}, 0.0, new double[]{30.0}, new int[]{75}, 2800, new String[]{"int", "regen_mana", "move_speed", "hard_to_tag"}, "rare", false, null);
139 | itemList[101] = new BuildItemVO(101, "Recipe: Force Staff", "item_recipe_force_staff", -1, null, -1, null, null, 900, null, "", false, null);
140 | itemList[102] = new BuildItemVO(102, "Force Staff", "item_force_staff", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{800}, 0.0, new double[]{20.0}, new int[]{25}, 2250, new String[]{"int", "damage", "attack_speed", "hard_to_tag"}, "rare", false, null);
141 | itemList[103] = new BuildItemVO(103, "Recipe: Dagon", "item_recipe_dagon", -1, null, -1, null, null, 1250, null, "", false, null);
142 | itemList[104] = new BuildItemVO(104, "Dagon", "item_dagon", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{600, 650, 700, 750, 800}, 0.0, new double[]{35.0, 30.0, 25.0, 20.0, 15.0}, new int[]{180, 160, 140, 120, 100}, 2800, new String[]{"damage", "int", "str", "agi", "hard_to_tag"}, "rare", false, null);
143 | itemList[105] = new BuildItemVO(105, "Recipe: Necronomicon", "item_recipe_necronomicon", -1, null, -1, null, null, 1250, null, "", false, null);
144 | itemList[106] = new BuildItemVO(106, "Necronomicon", "item_necronomicon", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, 0.0, new double[]{80.0}, new int[]{50}, 2700, new String[]{"int", "str", "hard_to_tag", "see_invis"}, "rare", false, null);
145 | itemList[107] = new BuildItemVO(107, "Recipe: Scepter", "item_recipe_ultimate_scepter", -1, null, -1, null, null, 0, null, "", false, null);
146 | itemList[108] = new BuildItemVO(108, "Scepter", "item_ultimate_scepter", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 4200, new String[]{"int", "str", "agi", "mana_pool", "health_pool", "hard_to_tag"}, "rare", false, null);
147 | itemList[109] = new BuildItemVO(109, "Recipe: Refresher", "item_recipe_refresher", -1, null, -1, null, null, 1875, null, "", false, null);
148 | itemList[110] = new BuildItemVO(110, "Refresher", "item_refresher", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, 0.0, new double[]{160.0}, new int[]{375}, 5300, new String[]{"regen_health", "regen_mana", "damage", "hard_to_tag"}, "rare", false, null);
149 | itemList[111] = new BuildItemVO(111, "Recipe: Assault Cuirass", "item_recipe_assault", -1, null, -1, null, null, 1300, null, "", false, null);
150 | itemList[112] = new BuildItemVO(112, "Assault Cuirass", "item_assault", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 5350, new String[]{"attack_speed", "armor", "hard_to_tag"}, "epic", false, null);
151 | itemList[113] = new BuildItemVO(113, "Recipe: Heart", "item_recipe_heart", -1, null, -1, null, null, 1200, null, "", false, null);
152 | itemList[114] = new BuildItemVO(114, "Heart", "item_heart", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, new double[]{6.0}, null, 5500, new String[]{"str", "regen_health", "health_pool"}, "epic", false, null);
153 | itemList[115] = new BuildItemVO(115, "Recipe: Black King Bar", "item_recipe_black_king_bar", -1, null, -1, null, null, 1300, null, "", false, null);
154 | itemList[116] = new BuildItemVO(116, "Black King Bar", "item_black_king_bar", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{80, 75, 70, 65, 60, 55, 50}, null, 3900, new String[]{"str", "damage", "hard_to_tag"}, "epic", false, null);
155 | itemList[117] = new BuildItemVO(117, "Aegis of Immortality", "item_aegis", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 0, null, "artifact", false, null);
156 | itemList[118] = new BuildItemVO(118, "Recipe: Shiva's Guard", "item_recipe_shivas_guard", -1, null, -1, null, null, 600, null, "", false, null);
157 | itemList[119] = new BuildItemVO(119, "Shiva's", "item_shivas_guard", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IGNORE_CHANNEL.behaviourValue, null, -1, new double[]{30}, new int[]{100}, 4700, new String[]{"int", "armor", "hard_to_tag"}, "epic", false, null);
158 | itemList[120] = new BuildItemVO(120, "Recipe: Bloodstone", "item_recipe_bloodstone", -1, null, -1, null, null, 0, null, "", false, null);
159 | itemList[121] = new BuildItemVO(121, "Bloodstone", "item_bloodstone", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue, new int[]{150}, 0.0, new double[]{300.0}, null, 5050, new String[]{"regen_health", "regen_mana", "mana_pool", "health_pool"}, "epic", false, null);
160 | itemList[122] = new BuildItemVO(122, "Recipe: Sphere", "item_recipe_sphere", -1, null, -1, null, null, 1325, null, "", false, null);
161 | itemList[123] = new BuildItemVO(123, "Sphere", "item_sphere", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 5175, new String[]{"regen_health", "regen_mana", "str", "agi", "int", "hard_to_tag"}, "epic", false, null);
162 | itemList[124] = new BuildItemVO(124, "Recipe: Vanguard", "item_recipe_vanguard", -1, null, -1, null, null, 0, null, "", false, null);
163 | itemList[125] = new BuildItemVO(125, "Vanguard", "item_vanguard", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2225, new String[]{"regen_health", "block", "health_pool"}, "epic", false, null);
164 | itemList[126] = new BuildItemVO(126, "Recipe: Blade Mail", "item_recipe_blade_mail", -1, null, -1, null, null, 0, null, "", false, null);
165 | itemList[127] = new BuildItemVO(127, "Blade Mail", "item_blade_mail", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{17.0}, new int[]{25}, 2200, new String[]{"damage", "armor", "int", "hard_to_tag"}, "epic", false, null);
166 | itemList[128] = new BuildItemVO(128, "Recipe: Soul Booster", "item_recipe_soul_booster", -1, null, -1, null, null, 0, null, "", false, null);
167 | itemList[129] = new BuildItemVO(129, "Soul Booster", "item_soul_booster", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 3300, new String[]{"regen_health", "regen_mana", "health_pool", "mana_pool"}, "epic", false, null);
168 | itemList[130] = new BuildItemVO(130, "Recipe: Hood of Defiance", "item_recipe_hood_of_defiance", -1, null, -1, null, null, 0, null, "", false, null);
169 | itemList[131] = new BuildItemVO(131, "Hood of Defiance", "item_hood_of_defiance", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2125, new String[]{"regen_health", "magic_resist"}, "epic", false, null);
170 | itemList[132] = new BuildItemVO(132, "Recipe: Rapier", "item_recipe_rapier", -1, null, -1, null, null, 0, null, "", false, null);
171 | itemList[133] = new BuildItemVO(133, "Rapier", "item_rapier", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 6200, new String[]{"damage"}, "epic", false, null);
172 | itemList[134] = new BuildItemVO(134, "Recipe: Monkey King Bar", "item_recipe_monkey_king_bar", -1, null, -1, null, null, 0, null, "", false, null);
173 | itemList[135] = new BuildItemVO(135, "Monkey King Bar", "item_monkey_king_bar", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 5400, new String[]{"damage", "attack_speed", "hard_to_tag"}, "epic", false, null);
174 | itemList[136] = new BuildItemVO(136, "Recipe: Radiance", "item_recipe_radiance", -1, null, -1, null, null, 1350, null, "", false, null);
175 | itemList[137] = new BuildItemVO(137, "Radiance", "item_radiance", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_TOGGLE.behaviourValue, null, -1, null, null, 5150, new String[]{"damage"}, "epic", false, null);
176 | itemList[138] = new BuildItemVO(138, "Recipe: Butterfly", "item_recipe_butterfly", -1, null, -1, null, null, 0, null, "", false, null);
177 | itemList[139] = new BuildItemVO(139, "Butterfly", "item_butterfly", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 6000, new String[]{"agi", "damage", "evasion", "attack_speed"}, "epic", false, null);
178 | itemList[140] = new BuildItemVO(140, "Recipe: Greater Crit", "item_recipe_greater_crit", -1, null, -1, null, null, 1000, null, "", false, null);
179 | itemList[141] = new BuildItemVO(141, "Greater Crit", "item_greater_crit", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 5550, new String[]{"damage", "crit"}, "epic", false, null);
180 | itemList[142] = new BuildItemVO(142, "Recipe: Basher", "item_recipe_basher", -1, null, -1, null, null, 1000, null, "", false, new String[]{"npc_dota_hero_spirit_breaker", "npc_dota_hero_faceless_void", "npc_dota_hero_slardar", "npc_dota_hero_troll_warlord"});
181 | itemList[143] = new BuildItemVO(143, "Basher", "item_basher", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, new double[]{2.0}, null, 2950, new String[]{"damage", "str", "hard_to_tag"}, "epic", false, null);
182 | itemList[144] = new BuildItemVO(144, "Recipe: Battlefury", "item_recipe_bfury", -1, null, -1, null, null, 0, null, "", false, null);
183 | itemList[145] = new BuildItemVO(145, "Battlefury", "item_bfury", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 4350, new String[]{"damage", "health_regen", "mana_regen", "hard_to_tag"}, "epic", false, null);
184 | itemList[146] = new BuildItemVO(146, "Recipe: Manta", "item_recipe_manta", -1, null, -1, null, null, 900, null, "", false, null);
185 | itemList[147] = new BuildItemVO(147, "Manta", "item_manta", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, null, 0.0, new double[]{50.0}, new int[]{165}, 5050, new String[]{"agi", "str", "int", "attack_speed", "move_speed", "hard_to_tag"}, "epic", false, null);
186 | itemList[148] = new BuildItemVO(148, "Recipe: Lesser Crit", "item_recipe_lesser_crit", -1, null, -1, null, null, 500, null, "", false, null);
187 | itemList[149] = new BuildItemVO(149, "Lesser Crit", "item_lesser_crit", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2150, new String[]{"damage", "crit"}, "epic", false, null);
188 | itemList[150] = new BuildItemVO(150, "Recipe: Armlet", "item_recipe_armlet", -1, null, -1, null, null, 700, null, "", false, null);
189 | itemList[151] = new BuildItemVO(151, "Armlet", "item_armlet", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_TOGGLE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IGNORE_CHANNEL.behaviourValue, null, -1, new double[]{2.0}, null, 2600, new String[]{"damage", "attack_speed", "armor", "regen_health", "hard_to_tag"}, "epic", false, null);
190 | itemList[183] = new BuildItemVO(183, "Recipe: Invisibility Sword", "item_recipe_invis_sword", -1, null, -1, null, null, 0, null, "", false, null);
191 | itemList[152] = new BuildItemVO(152, "Invisibility Sword", "item_invis_sword", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IGNORE_CHANNEL.behaviourValue, null, -1, new double[]{18.0}, new int[]{75}, 3000, new String[]{"damage", "attack_speed", "movespeed", "hard_to_tag"}, "epic", false, null);
192 | itemList[153] = new BuildItemVO(153, "Recipe: Sange and Yasha", "item_recipe_sange_and_yasha", -1, null, -1, null, null, 0, null, "", false, null);
193 | itemList[154] = new BuildItemVO(154, "Sange and Yasha", "item_sange_and_yasha", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 4100, new String[]{"damage", "str", "agi", "attack_speed", "unique"}, "artifact", false, null);
194 | itemList[155] = new BuildItemVO(155, "Recipe: Satanic", "item_recipe_satanic", -1, null, -1, null, null, 1100, null, "", false, null);
195 | itemList[156] = new BuildItemVO(156, "Satanic", "item_satanic", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{35.0}, null, 6150, new String[]{"damage", "str", "armor", "unique", "hard_to_tag"}, "artifact", false, null);
196 | itemList[157] = new BuildItemVO(157, "Recipe: Mjollnir", "item_recipe_mjollnir", -1, null, -1, null, null, 600, null, "", false, null);
197 | itemList[158] = new BuildItemVO(158, "Mjollnir", "item_mjollnir", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{600}, 0.0, new double[]{35.0}, new int[]{50}, 5400, new String[]{"damage", "attack_speed", "unique"}, "artifact", false, null);
198 | itemList[159] = new BuildItemVO(159, "Recipe: Skadi", "item_recipe_skadi", -1, null, -1, null, null, 0, null, "", false, null);
199 | itemList[160] = new BuildItemVO(160, "Skadi", "item_skadi", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 5675, new String[]{"agi", "str", "int", "hard_to_tag", "mana_pool", "health_pool", "unique"}, "artifact", false, null);
200 | itemList[161] = new BuildItemVO(161, "Recipe: Sange", "item_recipe_sange", -1, null, -1, null, null, 600, null, "", false, null);
201 | itemList[162] = new BuildItemVO(162, "Sange", "item_sange", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2050, new String[]{"damage", "str", "unique"}, "artifact", false, null);
202 | itemList[163] = new BuildItemVO(163, "Recipe: Helm of the Dominator", "item_recipe_helm_of_the_dominator", -1, null, -1, null, null, 0, null, "", false, null);
203 | itemList[164] = new BuildItemVO(164, "Helm of the Dominator", "item_helm_of_the_dominator", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{700}, 0.0, new double[]{60.0}, new int[]{75}, 1850, new String[]{"damage", "armor", "unique", "hard_to_tag"}, "artifact", false, null);
204 | itemList[165] = new BuildItemVO(165, "Recipe: Maelstrom", "item_recipe_maelstrom", -1, null, -1, null, null, 600, null, "", false, null);
205 | itemList[166] = new BuildItemVO(166, "Maelstrom", "item_maelstrom", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2700, new String[]{"damage", "attack_speed", "unique"}, "artifact", false, null);
206 | itemList[167] = new BuildItemVO(167, "Recipe: Desolator", "item_recipe_desolator", -1, null, -1, null, null, 900, null, "", false, null);
207 | itemList[168] = new BuildItemVO(168, "Desolator", "item_desolator", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 4100, new String[]{"damage", "unique"}, "artifact", false, null);
208 | itemList[169] = new BuildItemVO(169, "Recipe: Yasha", "item_recipe_yasha", -1, null, -1, null, null, 600, null, "", false, null);
209 | itemList[170] = new BuildItemVO(170, "Yasha", "item_yasha", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 2050, new String[]{"agi", "attack_speed", "move_speed"}, "artifact", false, null);
210 | itemList[171] = new BuildItemVO(171, "Recipe: Mask of Madness", "item_recipe_mask_of_madness", -1, null, -1, null, null, 1000, null, "", false, null);
211 | itemList[172] = new BuildItemVO(172, "Mask of Madness", "item_mask_of_madness", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IGNORE_CHANNEL.behaviourValue, null, -1, new double[]{25.0}, new int[]{25}, 1900, new String[]{"unique", "hard_to_tag"}, "artifact", false, null);
212 | itemList[173] = new BuildItemVO(173, "Recipe: Diffusal Blade", "item_recipe_diffusal_blade", -1, null, -1, null, null, 850, null, "", false, null);
213 | itemList[174] = new BuildItemVO(174, "Diffusal Blade", "item_diffusal_blade", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{600}, 0.0, new double[]{8.0}, new int[]{0}, 3300, new String[]{"agi", "int", "unique", "hard_to_tag"}, "artifact", false, null);
214 | itemList[175] = new BuildItemVO(175, "Recipe: Ethereal Blade", "item_recipe_ethereal_blade", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{800}, 0.0, new double[]{30.0}, new int[]{150}, 0, null, "epic", false, null);
215 | itemList[177] = new BuildItemVO(177, "Recipe: Soul Ring", "item_recipe_soul_ring", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue, null, -1, new double[]{30.0}, new int[]{0}, 125, null, "common", false, null);
216 | itemList[179] = new BuildItemVO(179, "Recipe: Arcane Boots", "item_recipe_arcane_boots", -1, null, -1, null, null, 0, null, "", false, null);
217 | itemList[180] = new BuildItemVO(180, "Arcane Boots", "item_arcane_boots", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{55.0}, new int[]{25}, 1450, new String[]{"move_speed", "boost_mana", "mana_pool"}, "rare", false, null);
218 | itemList[181] = new BuildItemVO(181, "Orb of Venom", "item_orb_of_venom", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 275, new String[]{"hard_to_tag"}, "secret_shop", true, null);
219 | itemList[184] = new BuildItemVO(184, "Recipe: Ancient Janggo of Endurance", "item_recipe_ancient_janggo", -1, null, -1, null, null, 800, null, "", false, null);
220 | itemList[185] = new BuildItemVO(185, "Ancient Janggo of Endurance", "item_ancient_janggo", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, null, -1, new double[]{30.0}, null, 1775, new String[]{"str", "agi", "int", "damage", "move_speed", "attack_speed", "hard_to_tag"}, "rare", false, null);
221 | itemList[186] = new BuildItemVO(186, "Recipe: Medallion of Courage", "item_recipe_medallion_of_courage", -1, null, -1, null, null, 200, null, "", false, null);
222 | itemList[187] = new BuildItemVO(187, "Medallion of Courage", "item_medallion_of_courage", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{1000}, -1, new double[]{7.0}, null, 1075, new String[]{"armor", "regen_mana", "hard_to_tag"}, "rare", false, null);
223 | itemList[188] = new BuildItemVO(188, "Smoke of Deceit", "item_smoke_of_deceit", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, null, -1, new double[]{90.0}, null, 100, new String[]{"consumable"}, "consumable", false, null);
224 | itemList[189] = new BuildItemVO(189, "Recipe: Veil of Discord", "item_recipe_veil_of_discord", -1, null, -1, null, null, 1250, null, "", false, null);
225 | itemList[190] = new BuildItemVO(190, "Veil of discord", "item_veil_of_discord", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_AOE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue, new int[]{1000}, 0.0, new double[]{30}, new int[]{75}, 2650, new String[]{"int", "armor", "regen_health", "hard_to_tag"}, "rare", false, null);
226 | itemList[205] = new BuildItemVO(205, "Recipe: Rod of Atos", "item_recipe_rod_of_atos", -1, null, -1, null, null, 0, null, "", false, null);
227 | itemList[206] = new BuildItemVO(206, "Rod of Atos", "item_rod_of_atos", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{1200}, 0.0, new double[]{16}, new int[]{50}, 3100, new String[]{"int", "armor", "regen_health"}, "rare", false, null);
228 | itemList[207] = new BuildItemVO(207, "Recipe: Abyssal Blade", "item_recipe_abyssal_blade", -1, null, -1, null, null, 0, null, "", false, null);
229 | itemList[208] = new BuildItemVO(208, "Abyssal Blade", "item_abyssal_blade", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{140}, 0.0, new double[]{60}, new int[]{150}, 6750, new String[]{"damage", "str", "hard_to_tag"}, "epic", false, null);
230 | itemList[209] = new BuildItemVO(209, "Recipe: Heaven's Halberd", "item_recipe_heavens_halberd", -1, null, -1, null, null, 0, null, "", false, null);
231 | itemList[210] = new BuildItemVO(210, "Heaven's Halberd", "item_heavens_halberd", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{600}, 0.0, new double[]{30}, new int[]{100}, 3850, new String[]{"str", "damage", "evasion"}, "artifact", false, null);
232 | itemList[211] = new BuildItemVO(211, "Recipe: Ring of Aquila", "item_recipe_ring_of_aquila", -1, null, -1, null, null, 0, null, "", false, null);
233 | itemList[212] = new BuildItemVO(212, "Ring of Aquila", "item_ring_of_aquila", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_TOGGLE.behaviourValue, null, -1, null, null, 985, null, "rare", false, null);
234 | itemList[213] = new BuildItemVO(213, "Recipe: Tranquil Boots", "item_recipe_tranquil_boots", -1, null, -1, null, null, 0, null, "", false, null);
235 | itemList[214] = new BuildItemVO(214, "Tranquil Boots", "item_tranquil_boots", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IGNORE_CHANNEL.behaviourValue, null, -1, new double[]{60.0}, new int[]{25}, 975, new String[]{"move_speed", "regen_health", "armor"}, "rare", false, null);
236 | itemList[215] = new BuildItemVO(215, "Shadow Amulet", "item_shadow_amulet", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IGNORE_CHANNEL.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_MOVEMENT.behaviourValue, null, -1, new double[]{0.0}, new int[]{0}, 1600, null, "", false, null);
237 | itemList[216] = new BuildItemVO(216, "Halloween Candy Corn", "item_halloween_candy_corn", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{350}, 0.0, new double[]{0.0}, null, 0, new String[]{"consumable"}, "consumable", false, null);
238 | itemList[217] = new BuildItemVO(217, "Mystery Rune Meat Hook ", "item_mystery_hook", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue, new int[]{1300}, 0.3, new double[]{11.0}, new int[]{140}, 0, new String[]{"consumable"}, "consumable", false, null);
239 | itemList[218] = new BuildItemVO(218, "Mystery Rune Mirana Arrow", "item_mystery_arrow", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DIRECTIONAL.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue, new int[]{3000}, 0.5, new double[]{2.0}, new int[]{0}, 0, new String[]{"consumable"}, "consumable", false, null);
240 | itemList[219] = new BuildItemVO(219, "Mystery Missile", "item_mystery_missile", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue, new int[]{1050}, 0.3, new double[]{20.0}, new int[]{0}, 0, new String[]{"consumable"}, "consumable", false, null);
241 | itemList[220] = new BuildItemVO(220, "Mystery Toss", "item_mystery_toss", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_AOE.behaviourValue, new int[]{1300}, 0.0, new double[]{2.0}, new int[]{0}, 0, new String[]{"consumable"}, "consumable", false, null);
242 | itemList[221] = new BuildItemVO(221, "Mystery Vacuum", "item_mystery_vacuum", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_AOE.behaviourValue, new int[]{500}, 0.4, new double[]{2.0}, new int[]{0}, 0, new String[]{"consumable"}, "consumable", false, null);
243 | itemList[226] = new BuildItemVO(226, "Halloween Rapier", "item_halloween_rapier", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 6200, new String[]{"damage"}, "epic", false, null);
244 | itemList[228] = new BuildItemVO(228, "Unknown", "item_greevil_whistle", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_CHANNELLED.behaviourValue, new int[]{0}, 0.0, new double[]{120.0}, null, 0, new String[]{"consumable"}, "consumable", false, null);
245 | itemList[235] = new BuildItemVO(235, "Toggleable whistle", "item_greevil_whistle_toggle", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_CHANNELLED.behaviourValue, new int[]{0}, 0.0, new double[]{2.0}, null, 0, new String[]{"consumable"}, "consumable", false, null);
246 | itemList[227] = new BuildItemVO(227, "XMas present", "item_present", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, new int[]{350}, 0.0, new double[]{0.0}, null, 0, new String[]{"consumable"}, "consumable", false, null);
247 | itemList[229] = new BuildItemVO(229, "Xmas Stocking", "item_winter_stocking", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, new int[]{350}, 0.0, new double[]{0.0}, null, 0, new String[]{"consumable"}, "consumable", false, null);
248 | itemList[230] = new BuildItemVO(230, "XMas Skates", "item_winter_skates", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_PASSIVE.behaviourValue, null, -1, null, null, 0, new String[]{"move_speed"}, "component", false, null);
249 | itemList[231] = new BuildItemVO(231, "Winter Cake", "item_winter_cake", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{150}, 0.0, null, null, 0, new String[]{"consumable"}, "consumable", false, null);
250 | itemList[232] = new BuildItemVO(232, "Winter Cookie", "item_winter_cookie", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{150}, 0.0, null, null, 0, new String[]{"consumable"}, "consumable", false, null);
251 | itemList[233] = new BuildItemVO(233, "Winter Coco", "item_winter_coco", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{150}, 0.0, null, null, 0, new String[]{"consumable"}, "consumable", false, null);
252 | itemList[234] = new BuildItemVO(234, "Winter Ham", "item_winter_ham", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{150}, 0.0, null, null, 0, new String[]{"consumable"}, "consumable", false, null);
253 | itemList[236] = new BuildItemVO(236, "Winter Kringle", "item_winter_kringle", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_UNIT_TARGET.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK.behaviourValue, new int[]{150}, 0.0, null, null, 0, new String[]{"consumable"}, "consumable", false, null);
254 | itemList[237] = new BuildItemVO(237, "Greevil Mushroom", "item_winter_mushroom", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, new int[]{150}, 0.0, null, null, 0, new String[]{"consumable"}, "consumable", false, null);
255 | itemList[238] = new BuildItemVO(238, "Greevil Treat", "item_winter_greevil_treat", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, new int[]{150}, 0.0, null, null, 0, new String[]{"consumable"}, "consumable", false, null);
256 | itemList[239] = new BuildItemVO(239, "Greevil Chow", "item_winter_greevil_garbage", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_IMMEDIATE.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_NO_TARGET.behaviourValue, new int[]{150}, 0.0, null, null, 0, new String[]{"consumable"}, "consumable", false, null);
257 | itemList[240] = new BuildItemVO(240, "Greevil Blink dagger", "item_winter_greevil_chewy", AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_POINT.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_ROOT_DISABLES.behaviourValue + AbilityVO.Behavior.DOTA_ABILITY_BEHAVIOR_CHANNELLED.behaviourValue, new int[]{400}, 0.0, new double[]{10.0}, new int[]{0}, 0, new String[]{"consumable"}, "consumable", false, null);
258 |
259 | }
260 |
261 | public BuildItemVO getItemById(int id) {
262 | BuildItemVO item = null;
263 |
264 | if(id < itemList.length) {
265 | item = itemList[id];
266 | }
267 |
268 | return item;
269 | }
270 | }
271 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/util/PlayerColors.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.util;
2 |
3 | import android.content.Context;
4 | import nl.ansuz.android.steam.R;
5 |
6 | /**
7 | * Utility class to look up player colours as seen in the HUD in-game.
8 | *
9 | * @author Wijnand
10 | */
11 | public class PlayerColors {
12 |
13 | /**
14 | * @param slot int - The player slot to look up the color for.
15 | * @param context {@link Context} - {@link Context} to use to retrieve resources.
16 | * @return int - The color (as seen on the HUD in-game) for the player in the passed in slot.
17 | */
18 | public static int getColorByPlayerSlot(int slot, Context context) {
19 | int colorId;
20 |
21 | switch (slot) {
22 | // Radiant
23 | case 0:
24 | colorId = R.color.radiant_blue;
25 | break;
26 | case 1:
27 | colorId = R.color.radiant_teal;
28 | break;
29 | case 2:
30 | colorId = R.color.radiant_purple;
31 | break;
32 | case 3:
33 | colorId = R.color.radiant_yellow;
34 | break;
35 | case 4:
36 | colorId = R.color.radiant_orange;
37 | break;
38 | // Dire
39 | case 128:
40 | colorId = R.color.dire_pink;
41 | break;
42 | case 129:
43 | colorId = R.color.dire_pus_yellow;
44 | break;
45 | case 130:
46 | colorId = R.color.dire_light_blue;
47 | break;
48 | case 131:
49 | colorId = R.color.dire_green;
50 | break;
51 | case 132:
52 | colorId = R.color.dire_brown;
53 | break;
54 | default:
55 | colorId = -1;
56 | break;
57 | }
58 |
59 | int color = 0;
60 | if (colorId > 0) {
61 | color = context.getResources().getColor(colorId);
62 | }
63 |
64 | return color;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/util/gson/DotaDeserializer.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.util.gson;
2 |
3 | import java.lang.reflect.Field;
4 |
5 | import android.util.Log;
6 |
7 | /**
8 | * Deserializer base.
9 | *
10 | * @author Wijnand
11 | */
12 | public class DotaDeserializer {
13 |
14 | private static final String LOG_TAG = "DotaDeserializer";
15 |
16 | /**
17 | * Copies the values from the base object to the actual target object.
18 | *
19 | * @param from The base object to copy the values from.
20 | * @param to The object to copy the values to.
21 | */
22 | protected T copyFromTo(Object from, T to) {
23 | Field[] baseFields = from.getClass().getFields();
24 |
25 | for(Field fromProperty : baseFields) {
26 | String propertyName = fromProperty.getName();
27 |
28 | Object value = null;
29 |
30 | try {
31 | value = from.getClass().getField(propertyName).get(from);
32 | } catch (NoSuchFieldException e) {
33 | Log.e(LOG_TAG, " - NoSuchFieldException when getting the value for: " + propertyName);
34 | continue;
35 | } catch (IllegalAccessException e) {
36 | Log.e(LOG_TAG, " - IllegalAccessException when getting the value for: " + propertyName);
37 | continue;
38 | }
39 |
40 | try {
41 | Field toField = to.getClass().getField(propertyName);
42 | toField.set(to, value);
43 | } catch (NoSuchFieldException e) {
44 | Log.e(LOG_TAG, " - NoSuchFieldException when setting the value for: " + propertyName);
45 | continue;
46 | } catch(IllegalAccessException e) {
47 | Log.e(LOG_TAG, " - IllegalAccessException when setting the value for: " + propertyName);
48 | continue;
49 | }
50 |
51 | }
52 |
53 | return to;
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/util/gson/TeamDetailsDeserializer.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.util.gson;
2 |
3 | import java.lang.reflect.Type;
4 |
5 | import nl.ansuz.android.steam.dota.vo.TeamDetailsVO;
6 | import nl.ansuz.android.steam.dota.vo.team.BaseTeamDetailsVO;
7 |
8 | import com.google.gson.JsonDeserializationContext;
9 | import com.google.gson.JsonDeserializer;
10 | import com.google.gson.JsonElement;
11 | import com.google.gson.JsonObject;
12 | import com.google.gson.JsonParseException;
13 | import com.google.gson.JsonPrimitive;
14 |
15 | /**
16 | * Custom GSON deserializer for the TeamDetailsVO, received by GetTeamInfoByTeamId API response.
17 | *
18 | * @author Wijnand
19 | */
20 | public class TeamDetailsDeserializer extends DotaDeserializer implements JsonDeserializer {
21 |
22 | private static String RATING_FIELD = "rating";
23 | private static String PLAYER_PREFIX = "player_";
24 | private static String PLAYER_SUFFIX = "_account_id";
25 | private static String LEAGUE_PREFIX = "league_id_";
26 |
27 | @Override
28 | public TeamDetailsVO deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
29 | throws JsonParseException {
30 |
31 | JsonObject jsonObject = json.getAsJsonObject();
32 | TeamDetailsVO result = new TeamDetailsVO();
33 |
34 | // Deserialize standard properties the easy way.
35 | BaseTeamDetailsVO detailsBase = context.deserialize(json, BaseTeamDetailsVO.class);
36 | result = copyFromTo(detailsBase, result);
37 |
38 | // Parse the rest by hand.
39 | // Rating.
40 | if (jsonObject.has(RATING_FIELD)) {
41 | JsonElement ratingElement = jsonObject.get(RATING_FIELD);
42 | if (ratingElement.isJsonPrimitive()) {
43 | JsonPrimitive ratingPrimitive = ratingElement.getAsJsonPrimitive();
44 | // Rating is sometimes "inactive".
45 | if (ratingPrimitive.isNumber()) {
46 | result.rating = ratingPrimitive.getAsInt();
47 | } else {
48 | result.rating = -1;
49 | }
50 | }
51 | }
52 |
53 | // Players: player_N_account_id
54 | int numberOfPlayers = getOccurrences(json.toString(), PLAYER_PREFIX);
55 | result.playerAccountIds = new int[numberOfPlayers];
56 |
57 | for (int i = 0; i < numberOfPlayers; i++) {
58 | String playerAccount = PLAYER_PREFIX + i + PLAYER_SUFFIX;
59 | if (jsonObject.has(playerAccount)) {
60 | JsonElement playerElement = jsonObject.get(playerAccount);
61 | result.playerAccountIds[i] = playerElement.getAsInt();
62 | }
63 | }
64 |
65 | // Leagues: league_id_N
66 | int numberOfLeagues = getOccurrences(json.toString(), LEAGUE_PREFIX);
67 | result.leagueIds = new int[numberOfLeagues];
68 |
69 | for (int k = 0; k < numberOfLeagues; k++) {
70 | String leagueId = LEAGUE_PREFIX + k;
71 | if (jsonObject.has(leagueId)) {
72 | JsonElement leagueElement = jsonObject.get(leagueId);
73 | result.leagueIds[k] = leagueElement.getAsInt();
74 | }
75 | }
76 |
77 | return result;
78 | }
79 |
80 | /**
81 | * Finds the number of occurrences of the needle in the haystack.
82 | *
83 | * @param haystack String - The haystack to search through.
84 | * @param needle String - The needle to find.
85 | * @return int - The number of occurrences of the needle in the haystack.
86 | */
87 | private int getOccurrences(String haystack, String needle) {
88 | return haystack.split(needle).length - 1;
89 | }
90 |
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/util/heroes/HeroVoComparator.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.util.heroes;
2 |
3 | import nl.ansuz.android.steam.dota.vo.HeroVO;
4 |
5 | import java.util.Comparator;
6 |
7 | /**
8 | * Comparator to sort a {@link HeroVO} Array by {@link HeroVO#id} ascending.
9 | *
10 | * @author Wijnand
11 | */
12 | public class HeroVoComparator implements Comparator {
13 |
14 | /** {@inheritDoc} */
15 | @Override
16 | public int compare(HeroVO left, HeroVO right) {
17 | int result = 0;
18 |
19 | if (left.id > right.id) {
20 | result = 1;
21 | } else if (left.id < right.id) {
22 | result = -1;
23 | }
24 |
25 | return result;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/util/matches/MatchVoComparator.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.util.matches;
2 |
3 | import nl.ansuz.android.steam.dota.vo.MatchVO;
4 |
5 | import java.util.Comparator;
6 |
7 | /**
8 | * Comparator to sort a {@link MatchVO} Array by {@link MatchVO#startTime} descending.
9 | *
10 | * @author Wijnand
11 | */
12 | public class MatchVoComparator implements Comparator {
13 |
14 | /** {@inheritDoc} */
15 | @Override
16 | public int compare(MatchVO left, MatchVO right) {
17 | int result = 0;
18 |
19 | if (left.startTime > right.startTime) {
20 | result = -1;
21 | } else if (left.startTime < right.startTime) {
22 | result = 1;
23 | }
24 |
25 | return result;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/AbilityUpgradeVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Ability upgrade details.
7 | *
8 | * @author Wijnand
9 | */
10 | public class AbilityUpgradeVO {
11 |
12 | /**
13 | * ID of the ability upgraded.
14 | * Pass this ID to {@link AbilityList#getAbilityById(int)} to obtain the actual ability.
15 | */
16 | @SerializedName("ability")
17 | public int ability;
18 |
19 | /**
20 | * Time since match start that the ability was upgraded.
21 | */
22 | @SerializedName("time")
23 | public int time;
24 |
25 | /**
26 | * The level of the player at time of upgrading.
27 | */
28 | @SerializedName("level")
29 | public int level;
30 | }
31 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/AdditionalUnitVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Additional playable unit.
7 | *
8 | * @author Wijnand
9 | */
10 | public class AdditionalUnitVO {
11 |
12 | /**
13 | * The name of the unit.
14 | */
15 | @SerializedName("unitname")
16 | public String unitName;
17 |
18 | /**
19 | * Numeric item ID for the top-left slot.
20 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
21 | */
22 | @SerializedName("item_0")
23 | public int item0;
24 |
25 | /**
26 | * Numeric item ID for the top-center slot.
27 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
28 | */
29 | @SerializedName("item_1")
30 | public int item1;
31 |
32 | /**
33 | * Numeric item ID for the top-right slot.
34 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
35 | */
36 | @SerializedName("item_2")
37 | public int item2;
38 |
39 | /**
40 | * Numeric item ID for the bottom-left slot.
41 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
42 | */
43 | @SerializedName("item_3")
44 | public int item3;
45 |
46 | /**
47 | * Numeric item ID for the bottom-center slot.
48 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
49 | */
50 | @SerializedName("item_4")
51 | public int item4;
52 |
53 | /**
54 | * Numeric item ID for the bottom-right slot.
55 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
56 | */
57 | @SerializedName("item_5")
58 | public int item5;
59 | }
60 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/BuildItemVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import nl.ansuz.android.steam.dota.vo.heroes.AbilityVO;
4 |
5 | /**
6 | * Representation of a DotA hero build item.
7 | *
8 | * @author Wijnand
9 | */
10 | public class BuildItemVO {
11 |
12 | /**
13 | * Undocumented
14 | */
15 | public enum Shareability {
16 | ITEM_NOT_SHAREABLE;
17 | }
18 |
19 | // General
20 | /**
21 | * unique ID number for this item.
22 | */
23 | public int id;
24 | /**
25 | * Translated name of the ability, i.e. "Blink dagger".
26 | */
27 | public String abilityName;
28 | /**
29 | * Translation token for the ability name, i.e. "item_blink".
30 | */
31 | public String abilityNameToken;
32 | public int abilityBehavior;
33 |
34 | // Stats
35 | public int[] abilityCastRange;
36 | public double abilityCastPoint;
37 | public double[] abilityCooldown;
38 | public int[] abilityManaCost;
39 |
40 | // Item Info
41 | public int itemCost;
42 | public String[] itemShopTags;
43 | public String itemQuality;
44 | public boolean sideShop;
45 | public String[] invalidHeroes;
46 |
47 | public BuildItemVO(int id, String abilityName, String abilityNameToken,
48 | int abilityBehavior, int[] abilityCastRange,
49 | double abilityCastPoint, double[] abilityCooldown,
50 | int[] abilityManaCost, int itemCost, String[] itemShopTags,
51 | String itemQuality, boolean sideShop, String[] invalidHeroes) {
52 |
53 | this.id = id;
54 | this.abilityName = abilityName;
55 | this.abilityNameToken = abilityNameToken;
56 | this.abilityBehavior = abilityBehavior;
57 |
58 | this.abilityCastRange = abilityCastRange;
59 | this.abilityCastPoint = abilityCastPoint;
60 | this.abilityCooldown = abilityCooldown;
61 | this.abilityManaCost = abilityManaCost;
62 |
63 | this.itemCost = itemCost;
64 | this.itemShopTags = itemShopTags;
65 | this.itemQuality = itemQuality;
66 | this.sideShop = sideShop;
67 | this.invalidHeroes = invalidHeroes;
68 | }
69 |
70 | /**
71 | * Creates a URL to download the item image from.
72 | */
73 | public String getImageUrl() {
74 | return "http://media.steampowered.com/apps/dota2/images/items/" + abilityName.replace("item_", "") + "_lg.png";
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/HeroVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Representation of a Dota 2 Hero.
7 | *
8 | * @author Wijnand
9 | */
10 | public class HeroVO {
11 |
12 | public static final String IMAGE_URL_PREFIX = "http://media.steampowered.com/apps/dota2/images/heroes/";
13 |
14 | public static final String TINY_IMAGE_URL_SUFFIX = "_eg.png";
15 | public static final String SMALL_IMAGE_URL_SUFFIX = "_sb.png";
16 | public static final String LARGE_IMAGE_URL_SUFFIX = "_lg.png";
17 | public static final String FULL_IMAGE_URL_SUFFIX = "_full.png";
18 | public static final String PORTRAIT_IMAGE_URL_SUFFIX = "_vert.jpg";
19 |
20 | public static final String HERO_NAME_PREFIX = "npc_dota_hero_";
21 | public static final String HERO_NAME_PREFIX_REPLACEMENT = "";
22 |
23 | @SerializedName("name")
24 | public String name;
25 |
26 | @SerializedName("id")
27 | public int id;
28 |
29 | @SerializedName("localized_name")
30 | public String localizedName;
31 |
32 | /**
33 | * Constructs an image URL based on the suffix.
34 | *
35 | * @param suffix String - The suffix to use to append to the URL.
36 | * @return Hero icon URL.
37 | */
38 | private String getImageUrl(String suffix) {
39 | return IMAGE_URL_PREFIX + name.replace(HERO_NAME_PREFIX, HERO_NAME_PREFIX_REPLACEMENT) + suffix;
40 | }
41 |
42 | /**
43 | * @return The URL for the full sized Hero icon (256x144 px).
44 | */
45 | public String getFullImageUrl() {
46 | return getImageUrl(FULL_IMAGE_URL_SUFFIX);
47 | }
48 |
49 | /**
50 | * @return The URL for the large Hero icon (205x115 px).
51 | */
52 | public String getLargeImageUrl() {
53 | return getImageUrl(LARGE_IMAGE_URL_SUFFIX);
54 | }
55 |
56 | /**
57 | * @return The URL for the small Hero icon (59x33 px).
58 | */
59 | public String getSmallImageUrl() {
60 | return getImageUrl(SMALL_IMAGE_URL_SUFFIX);
61 | }
62 |
63 | /**
64 | * @return The URL for the tiny Hero icon (35x20 px).
65 | */
66 | public String getTinyImageUrl() {
67 | return getImageUrl(TINY_IMAGE_URL_SUFFIX);
68 | }
69 |
70 | /**
71 | * @return The URL for the portrait Hero icon (235x272 px).
72 | */
73 | public String getPortaitImageUrl() {
74 | return getImageUrl(PORTRAIT_IMAGE_URL_SUFFIX);
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/LeagueVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * A DotA 2 league.
7 | *
8 | * @author Wijnand
9 | */
10 | public class LeagueVO {
11 |
12 | /**
13 | * The name of the league.
14 | */
15 | @SerializedName("name")
16 | public String name;
17 |
18 | /**
19 | * The league's unique ID.
20 | */
21 | @SerializedName("leagueid")
22 | public int leagueId;
23 |
24 | /**
25 | * A description of the league.
26 | */
27 | @SerializedName("description")
28 | public String description;
29 |
30 | /**
31 | * The league's website.
32 | */
33 | @SerializedName("tournament_url")
34 | public String tournamentUrl;
35 | }
36 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/MatchVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Representation of a Dota match.
7 | *
8 | * @author Wijnand
9 | */
10 | public class MatchVO {
11 |
12 | /**
13 | * The unique ID of the match.
14 | */
15 | @SerializedName("match_id")
16 | public long matchId;
17 |
18 | /**
19 | * A 'sequence number', representing the order in which matches were recorded.
20 | */
21 | @SerializedName("match_seq_num")
22 | public long matchSequenceNumber;
23 |
24 | /**
25 | * Unix timestamp of when the match began.
26 | */
27 | @SerializedName("start_time")
28 | public int startTime;
29 |
30 | /**
31 | * @see GetMatchDetailsResponse#LobbyType
32 | */
33 | @SerializedName("lobby_type")
34 | public int lobbyType;
35 |
36 | /**
37 | * The list of players within the match.
38 | */
39 | @SerializedName("players")
40 | public PlayerVO[] players;
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/PickBanVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * A pick or ban from Captain's Mode.
7 | *
8 | * @author Wijnand
9 | */
10 | public class PickBanVO {
11 |
12 | /**
13 | * DotA team.
14 | *
15 | * @author Wijnand
16 | */
17 | public enum Team {
18 | RADIANT,
19 | DIRE,
20 | BROADCASTER,
21 | UNASSIGNED;
22 |
23 | private static final Team[] teamValues = Team.values();
24 |
25 | public static Team fromInteger(int i) {
26 | return teamValues[i];
27 | }
28 | }
29 |
30 | /**
31 | * Whether this entry is a pick (true) or a ban (false).
32 | */
33 | @SerializedName("is_pick")
34 | public boolean isPick;
35 |
36 | /**
37 | * The hero's unique ID. A list of hero IDs can be found via the GetHeroes method.
38 | */
39 | @SerializedName("hero_id")
40 | public int heroId;
41 |
42 | /**
43 | * The team who chose the pick or ban; 0 for Radiant, 1 for Dire.
44 | */
45 | @SerializedName("team")
46 | public int team;
47 |
48 | /**
49 | * The order of which the picks and bans were selected; 0-19.
50 | */
51 | @SerializedName("order")
52 | public int order;
53 |
54 | /**
55 | * @return Whether or not the team is Radiant.
56 | */
57 | public boolean isRadiant() {
58 | return team == Team.RADIANT.ordinal();
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/PlayerVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import nl.ansuz.android.steam.dota.vo.players.BasePlayerVO;
4 |
5 | import com.google.gson.annotations.SerializedName;
6 |
7 | /**
8 | * Representation of a Dota player.
9 | *
10 | * @author Wijnand
11 | */
12 | public class PlayerVO extends BasePlayerVO {
13 |
14 | /**
15 | * Player leave status.
16 | *
17 | * @author Wijnand
18 | */
19 | public enum LeaverStatus {
20 | /**
21 | * Didn't leave the game.
22 | */
23 | NONE,
24 | /**
25 | * Disconnected from the game.
26 | */
27 | DISCONNECTED,
28 | /**
29 | * Disconnected, left for longer than 5 minutes and is counted as abandoned.
30 | */
31 | DISCONNECTED_TOO_LONG,
32 | /**
33 | * Disconnected and manually clicked on "leave game", counted as abandon.
34 | */
35 | ABANDONED,
36 | /**
37 | * AFK.
38 | */
39 | AWAY_FROM_KEYBOARD,
40 | /**
41 | * Never connected.
42 | */
43 | NEVER_CONNECTED,
44 | /**
45 | * Never connected, game went on for some time and is counted as abandon.
46 | */
47 | NEVER_CONNECTED_TOO_LONG;
48 |
49 | private static final LeaverStatus[] leaverStatus = LeaverStatus.values();
50 |
51 | public static LeaverStatus fromInteger(int i) {
52 | if(i < 0 || i > leaverStatus.length - 1) {
53 | i = 0;
54 | }
55 | return leaverStatus[i];
56 | }
57 | }
58 |
59 | /**
60 | * An 8-bit unsigned int: if the left-most bit is set, the player was on dire.
61 | * The two right-most bits represent the player slot (0-4).
62 | *
63 | * - 0-4: Radiant.
64 | * - 128-132: Dire.
65 | */
66 | @SerializedName("player_slot")
67 | public int playerSlot;
68 |
69 | /**
70 | * Numeric item ID for the top-left slot.
71 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
72 | */
73 | @SerializedName("item_0")
74 | public int item0;
75 |
76 | /**
77 | * Numeric item ID for the top-center slot.
78 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
79 | */
80 | @SerializedName("item_1")
81 | public int item1;
82 |
83 | /**
84 | * Numeric item ID for the top-right slot.
85 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
86 | */
87 | @SerializedName("item_2")
88 | public int item2;
89 |
90 | /**
91 | * Numeric item ID for the bottom-left slot.
92 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
93 | */
94 | @SerializedName("item_3")
95 | public int item3;
96 |
97 | /**
98 | * Numeric item ID for the bottom-center slot.
99 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
100 | */
101 | @SerializedName("item_4")
102 | public int item4;
103 |
104 | /**
105 | * Numeric item ID for the bottom-right slot.
106 | * Get the item details from {@link HeroBuildItemList#getItemById(int)}.
107 | */
108 | @SerializedName("item_5")
109 | public int item5;
110 |
111 | /**
112 | * Number of kills the player got.
113 | */
114 | @SerializedName("kills")
115 | public int kills;
116 |
117 | /**
118 | * Number of times the player died.
119 | */
120 | @SerializedName("deaths")
121 | public int deaths;
122 |
123 | /**
124 | * Number of assists the player got.
125 | */
126 | @SerializedName("assists")
127 | public int assists;
128 |
129 | /**
130 | * @see LeaverStatus
131 | */
132 | @SerializedName("leaver_status")
133 | public int leaverStatus;
134 |
135 | /**
136 | * Amount of gold the player had left at the end of the match.
137 | */
138 | @SerializedName("gold")
139 | public int gold;
140 |
141 | /**
142 | * Number of times a player last-hit a creep.
143 | */
144 | @SerializedName("last_hits")
145 | public int lastHits;
146 |
147 | /**
148 | * Number of times a player denied a creep.
149 | */
150 | @SerializedName("denies")
151 | public int denies;
152 |
153 | /**
154 | * Total gold per minute.
155 | */
156 | @SerializedName("gold_per_min")
157 | public int goldPerMinute;
158 |
159 | /**
160 | * Total experience per minute.
161 | */
162 | @SerializedName("xp_per_min")
163 | public int xpPerMinute;
164 |
165 | /**
166 | * Total amount of gold the player spent during the match.
167 | */
168 | @SerializedName("gold_spent")
169 | public int goldSpent;
170 |
171 | /**
172 | * Amount of damage the player dealt to heroes.
173 | */
174 | @SerializedName("hero_damage")
175 | public int heroDamage;
176 |
177 | /**
178 | * Amount of damage the player dealt to towers.
179 | */
180 | @SerializedName("tower_damage")
181 | public int towerDamage;
182 |
183 | /**
184 | * Amount of damage the player healed.
185 | */
186 | @SerializedName("hero_healing")
187 | public int heroHealing;
188 |
189 | /**
190 | * The player's level at the end of the match.
191 | */
192 | @SerializedName("level")
193 | public int level;
194 |
195 | /**
196 | * A list detailing a player's ability upgrades.
197 | */
198 | @SerializedName("ability_upgrades")
199 | public AbilityUpgradeVO[] abilityUpgrades;
200 |
201 | /**
202 | * Additional playable units owned by the player.
203 | */
204 | @SerializedName("additional_units")
205 | public AdditionalUnitVO[] additionalUnits;
206 |
207 | /**
208 | * @return Whether or not the player was in the Radiant team.
209 | */
210 | public boolean isRadiant() {
211 | return playerSlot < 5;
212 | }
213 |
214 | /**
215 | * @param radiantWin boolean - Whether or not radiant won.
216 | * @return boolean - Whether or not the player was on the winning side.
217 | */
218 | public boolean hasWon(boolean radiantWin) {
219 | return isRadiant() ? radiantWin : !radiantWin;
220 | }
221 |
222 | /**
223 | * @return The player's KDR.
224 | */
225 | public double getKillDeathRadio() {
226 | return kills / deaths;
227 | }
228 |
229 | /**
230 | * @return Total amount of gold earned during the match.
231 | */
232 | public int getTotalGold() {
233 | return goldSpent + gold;
234 | }
235 |
236 | }
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/RarityVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * DotA 2 rarity.
7 | *
8 | * @author Wijnand Warren
9 | */
10 | public class RarityVO {
11 |
12 | /**
13 | * The internal rarity name string.
14 | */
15 | @SerializedName("name")
16 | public String name;
17 |
18 | /**
19 | * The localized name of the rarity for use in name display.
20 | */
21 | @SerializedName("localized_name")
22 | public String localizedName;
23 |
24 | /**
25 | * ID of rarity, used for indexing.
26 | */
27 | @SerializedName("id")
28 | public int id;
29 |
30 | /**
31 | * Sorting and logical order of rarities, from most distributed to least.
32 | */
33 | @SerializedName("order")
34 | public int order;
35 |
36 | /**
37 | * String of the hexadecimal RGB tuple of the rarity name as it is displayed in-game.
38 | */
39 | @SerializedName("color")
40 | public String color;
41 | }
42 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/TeamDetailsVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import nl.ansuz.android.steam.dota.vo.team.BaseTeamDetailsVO;
4 |
5 | import com.google.gson.annotations.SerializedName;
6 |
7 | /**
8 | * DotA 2 league team details.
9 | * NOTE: Use the {@link TeamDetailsDeserializer} to deserialize the API response.
10 | *
11 | * @author Wijnand
12 | */
13 | public class TeamDetailsVO extends BaseTeamDetailsVO {
14 |
15 | /**
16 | * The team's rating.
17 | */
18 | @SerializedName("rating")
19 | public int rating;
20 |
21 | /**
22 | * 32-bit account ID. Where N is incremental from 0 for every player on the team.
23 | * player_N_account_id
24 | */
25 | public int[] playerAccountIds;
26 |
27 | /**
28 | * Leagues this team is participating in?
29 | * league_id_N
30 | */
31 | public int[] leagueIds;
32 |
33 | /**
34 | * @return Whether or not this team has a sponsor.
35 | */
36 | public boolean hasSponsor() {
37 | return logoSponsor > 0;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/TeamMatchTotalsVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | /**
4 | * Match totals for Radiant/Dire.
5 | *
6 | * @author Wijnand
7 | */
8 | public class TeamMatchTotalsVO {
9 |
10 | /**
11 | * The total gold earned by the team.
12 | * NOTE: This is an estimation and might be slightly off compared to the actual number.
13 | */
14 | public int totalGold;
15 |
16 | /**
17 | * The total XP earned by the team.
18 | * NOTE: This is an estimation and might be slightly off compared to the actual number.
19 | */
20 | public int totalXp;
21 |
22 | /**
23 | * The total kills by the team.
24 | */
25 | public int totalKills;
26 |
27 | /**
28 | * The total deaths by the team.
29 | */
30 | public int totalDeaths;
31 |
32 | /**
33 | * The total assists by the team.
34 | */
35 | public int totalAssists;
36 |
37 | /**
38 | * CONSTRUCTOR
39 | */
40 | public TeamMatchTotalsVO() {
41 | init();
42 | }
43 |
44 | /**
45 | * Initializes this class.
46 | */
47 | private void init() {
48 | totalGold = -1;
49 | totalXp = -1;
50 | totalKills = -1;
51 | totalDeaths = -1;
52 | totalAssists = -1;
53 | }
54 | }
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/TeamVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * DotA 2 league team. (During a match.)
7 | *
8 | * @author Wijnand
9 | */
10 | public class TeamVO {
11 |
12 | /**
13 | * The team's name.
14 | */
15 | @SerializedName("team_name")
16 | public String teamName;
17 |
18 | /**
19 | * The team's unique ID.
20 | */
21 | @SerializedName("team_id")
22 | public int teamId;
23 |
24 | /**
25 | * The UGC id for the team logo. You can resolve this with the GetUGCFileDetails method.
26 | */
27 | @SerializedName("team_logo")
28 | public long teamLogo;
29 |
30 | /**
31 | * Whether the players for this team are all team members.
32 | */
33 | @SerializedName("complete")
34 | public boolean complete;
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/heroes/AbilityVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo.heroes;
2 |
3 | /**
4 | * DotA hero ability.
5 | * Default values are based on ability with ID 0 in "npc_abilities.txt".
6 | *
7 | * @author Wijnand
8 | */
9 | public class AbilityVO {
10 |
11 | public enum Type {
12 | DOTA_ABILITY_TYPE_BASIC,
13 | DOTA_ABILITY_TYPE_ULTIMATE,
14 | DOTA_ABILITY_TYPE_ATTRIBUTES;
15 | }
16 |
17 | public enum Behavior {
18 | /**
19 | * No behaviour.
20 | */
21 | DOTA_ABILITY_BEHAVIOR_NONE(0),
22 | /**
23 | * This ability can be owned by a unit but can't be casted and wont show
24 | * up on the HUD.
25 | */
26 | DOTA_ABILITY_BEHAVIOR_HIDDEN(1),
27 | /**
28 | * Can't be casted like above but this one shows up on the ability HUD.
29 | */
30 | DOTA_ABILITY_BEHAVIOR_PASSIVE(2),
31 | /**
32 | * Doesn't need a target to be cast, ability fires off as soon as the
33 | * button is pressed.
34 | */
35 | DOTA_ABILITY_BEHAVIOR_NO_TARGET(4),
36 | /**
37 | * Ability needs a target to be casted on.
38 | */
39 | DOTA_ABILITY_BEHAVIOR_UNIT_TARGET(8),
40 | /**
41 | * Ability can be cast anywhere the mouse cursor is. (If a unit is
42 | * clicked it will just be cast where the unit was standing)
43 | */
44 | DOTA_ABILITY_BEHAVIOR_POINT(16),
45 | /**
46 | * This ability draws a radius where the ability will have effect. Kinda
47 | * like POINT but with a an area of effect display.
48 | */
49 | DOTA_ABILITY_BEHAVIOR_AOE(32),
50 | /**
51 | * This ability probably can be casted or have a casting scheme but
52 | * cannot be learned. (These are usually abilities that are temporary
53 | * like techie's bomb detonate.)
54 | */
55 | DOTA_ABILITY_BEHAVIOR_NOT_LEARNABLE(64),
56 | /**
57 | * This abillity is channelled. If the user moves or is silenced the
58 | * ability is interrupted.
59 | */
60 | DOTA_ABILITY_BEHAVIOR_CHANNELLED(128),
61 | /**
62 | * This ability is tied up to an item.
63 | */
64 | DOTA_ABILITY_BEHAVIOR_ITEM(256),
65 | /**
66 | * This ability can be insta-toggled.
67 | */
68 | DOTA_ABILITY_BEHAVIOR_TOGGLE(512),
69 | /**
70 | * This ability has a direction from the hero.
71 | */
72 | DOTA_ABILITY_BEHAVIOR_DIRECTIONAL(1024),
73 | /**
74 | * This ability does not interrupt other abilities.
75 | */
76 | DOTA_ABILITY_BEHAVIOR_IMMEDIATE(2048),
77 | /**
78 | * No idea what this one is, it isn't documented.
79 | */
80 | DOTA_ABILITY_BEHAVIOR_ROOT_DISABLES(4096),
81 | /**
82 | * No idea what this one is, it isn't documented.
83 | */
84 | DOTA_ABILITY_BEHAVIOR_NOASSIST(8192),
85 | /**
86 | * No idea what this one is, it isn't documented.
87 | */
88 | DOTA_ABILITY_BEHAVIOR_IGNORE_CHANNEL(1<<14),
89 | /**
90 | * Undocumented.
91 | */
92 | DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK(1<<15),
93 | /**
94 | * Undocumented.
95 | */
96 | DOTA_ABILITY_BEHAVIOR_DONT_RESUME_MOVEMENT(1<<16),
97 | /**
98 | * Undocumented.
99 | */
100 | DOTA_ABILITY_BEHAVIOR_IGNORE_PSEUDO_QUEUE(1<<17),
101 | /**
102 | * Undocumented.
103 | */
104 | DOTA_ABILITY_BEHAVIOR_AUTOCAST(1<<18),
105 | /**
106 | * Undocumented.
107 | */
108 | DOTA_ABILITY_BEHAVIOR_ATTACK(1<<19),
109 | /**
110 | * Undocumented.
111 | */
112 | DOTA_ABILITY_BEHAVIOR_AURA(1<<20),
113 | /**
114 | * Undocumented.
115 | */
116 | DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING(1<<21),
117 | /**
118 | * Undocumented.
119 | */
120 | DOTA_ABILITY_BEHAVIOR_NORMAL_WHEN_STOLEN(1<<22),
121 | /**
122 | * Undocumented.
123 | */
124 | DOTA_ABILITY_BEHAVIOR_DONT_ALERT_TARGET(1<<22),
125 | /**
126 | * Undocumented.
127 | */
128 | DOTA_ABILITY_BEHAVIOR_RUNE_TARGET(1<<23),
129 | /**
130 | * Undocumented.
131 | */
132 | DOTA_ABILITY_BEHAVIOR_UNRESTRICTED(1<<24),
133 | /**
134 | * Undocumented.
135 | */
136 | DOTA_ABILITY_TYPE_ULTIMATE(1<<25),
137 | /**
138 | * Undocumented.
139 | */
140 | DOTA_ABILITY_BEHAVIOR_DONT_CANCEL_MOVEMENT(1<<26);
141 |
142 | public final int behaviourValue;
143 |
144 | Behavior(int value) {
145 | behaviourValue = value;
146 | }
147 | }
148 |
149 | private final static String IMAGE_URL_PREFIX = "http://media.steampowered.com/apps/dota2/images/abilities/";
150 | private final static String IMAGE_URL_SUFFIX = "_hp1.png";
151 |
152 | // General
153 | public int id;
154 | public String name;
155 | public String nameToken;
156 | public Type type;
157 | public int behavior;
158 | public int onCastbar;
159 | public int onLearnbar;
160 |
161 | // Stats
162 | public int[] castRange;
163 | public int castRangeBuffer;
164 | public double[] castPoint;
165 | public double[] channelTime;
166 | public double[] cooldown;
167 | public double[] duration;
168 | public String sharedCooldown;
169 | public double[] damage;
170 | public int[] manaCost;
171 | public double modifierSupportValue;
172 | public int modifierSupportBonus;
173 |
174 | public AbilityVO(int id, String name, String nameToken, Type type, int behavior, int onCastbar, int onLearnbar,
175 | int[] castRange, int castRangeBuffer, double[] castPoint, double[] channelTime, double[] cooldown,
176 | double[] duration, String sharedCooldown, double[] damage, int[] manaCost,
177 | double modifierSupportValue, int modifierSupportBonus) {
178 |
179 | init();
180 |
181 | // General
182 | this.id = id;
183 | this.name = name;
184 | this.nameToken = nameToken;
185 | if (type != null) {
186 | this.type = type;
187 | }
188 | this.behavior = behavior;
189 | if (onCastbar > 0) {
190 | this.onCastbar = onCastbar;
191 | }
192 | if (onLearnbar > 0) {
193 | this.onLearnbar = onLearnbar;
194 | }
195 |
196 | // Stats
197 | if (castRange != null) {
198 | this.castRange = castRange;
199 | }
200 | if (castRangeBuffer > 0) {
201 | this.castRangeBuffer = castRangeBuffer;
202 | }
203 | if (castPoint != null) {
204 | this.castPoint = castPoint;
205 | }
206 | if (channelTime != null) {
207 | this.channelTime = channelTime;
208 | }
209 | if (cooldown != null) {
210 | this.cooldown = cooldown;
211 | }
212 | if (duration != null) {
213 | this.duration = duration;
214 | }
215 | this.sharedCooldown = sharedCooldown;
216 | if (damage != null) {
217 | this.damage = damage;
218 | }
219 | if (manaCost != null) {
220 | this.manaCost = manaCost;
221 | }
222 | if (modifierSupportValue > -1) {
223 | this.modifierSupportValue = modifierSupportValue;
224 | }
225 | if (modifierSupportBonus > -1) {
226 | this.modifierSupportBonus = modifierSupportBonus;
227 | }
228 | }
229 |
230 | /**
231 | * Initializes this class.
232 | */
233 | private void init() {
234 | // General
235 | id = 0;
236 | name = "base";
237 | nameToken = "";
238 | type = Type.DOTA_ABILITY_TYPE_BASIC;
239 | behavior = Behavior.DOTA_ABILITY_BEHAVIOR_NONE.behaviourValue;
240 | onCastbar = 1;
241 | onLearnbar = 1;
242 |
243 | // Stats
244 | castRange = new int[]{0};
245 | castRangeBuffer = 250;
246 | castPoint = new double[]{0.0, 0.0, 0.0, 0.0};
247 | channelTime = new double[]{0.0, 0.0, 0.0, 0.0};
248 | cooldown = new double[]{0.0, 0.0, 0.0, 0.0};
249 | duration = new double[]{0.0, 0.0, 0.0, 0.0};
250 | sharedCooldown = "";
251 | damage = new double[]{0, 0, 0, 0};
252 | manaCost = new int[]{0, 0, 0, 0};
253 | modifierSupportValue = 1.0;
254 | modifierSupportBonus = 0;
255 | }
256 |
257 | /**
258 | * Creates a URL to download the item image from.
259 | */
260 | public String getImageUrl() {
261 | return IMAGE_URL_PREFIX + nameToken + IMAGE_URL_SUFFIX;
262 | }
263 |
264 | }
265 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/match/LiveLeagueMatchVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo.match;
2 |
3 | import nl.ansuz.android.steam.dota.util.DotaBuildingStatus.DotaTower;
4 | import nl.ansuz.android.steam.dota.vo.TeamVO;
5 | import nl.ansuz.android.steam.dota.vo.players.LiveLeaguePlayerVO;
6 |
7 | import com.google.gson.annotations.SerializedName;
8 |
9 | public class LiveLeagueMatchVO {
10 |
11 | /**
12 | * The list of players within a game.
13 | */
14 | @SerializedName("players")
15 | public LiveLeaguePlayerVO[] players;
16 |
17 | /**
18 | * Information about the team playing as Radiant for this match.
19 | */
20 | @SerializedName("radiant_team")
21 | public TeamVO radiantTeam;
22 |
23 |
24 | /**
25 | * Information about the team playing as Dire for this match.
26 | */
27 | @SerializedName("dire_team")
28 | public TeamVO direTeam;
29 |
30 | /**
31 | * Unique ID for the matches lobby.
32 | */
33 | @SerializedName("lobby_id")
34 | public long lobbyId;
35 |
36 | /**
37 | * Number of spectators at time of query.
38 | */
39 | @SerializedName("spectators")
40 | public int spectators;
41 |
42 | /**
43 | * The matches tower status is given as a 32-bit unsigned integer, with the rightmost 22 bits dictating tower state.
44 | * The higher bits (leftmost) dictate the Dire team's tower status, and the lower bits (rightmost) dictate the
45 | * Radiant team's tower status; within each 11bit segment, each bit represents an individual tower.
46 | */
47 | @SerializedName("tower_state")
48 | public int towerState;
49 |
50 | /**
51 | * Unique ID for the league of the match being played. A list of league IDs can be found via the GetLeagueListing
52 | * method.
53 | */
54 | @SerializedName("league_id")
55 | public int leagueId;
56 |
57 | /**
58 | * @return Radiant's tower state to be used in conjunction with {@link DotaBuildingStatus#isTowerUp(int, DotaTower)}.
59 | */
60 | public int getRadiantTowerState() {
61 | int radiantMask = Integer.parseInt("00000000000000000000011111111111", 2);
62 | return towerState & radiantMask;
63 | }
64 |
65 | /**
66 | * @return Dire's tower state to be used in conjunction with {@link DotaBuildingStatus#isTowerUp(int, DotaTower)}.
67 | */
68 | public int getDireTowerState() {
69 | int direMask = Integer.parseInt("00000000001111111111100000000000", 2);
70 | int direStatus = towerState & direMask;
71 | return direStatus >> 11;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/match/ScheduledLeagueMatchVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo.match;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 | import nl.ansuz.android.steam.dota.vo.TeamVO;
5 |
6 | /**
7 | * Simple representation of a scheduled league match.
8 | *
9 | * @author Wijnand
10 | */
11 | public class ScheduledLeagueMatchVO {
12 |
13 | /**
14 | * Unique ID for the league of the match being played.
15 | * A list of league IDs can be found via the {@link GetLeagueListing} method.
16 | */
17 | @SerializedName("league_id")
18 | public int leagueId;
19 |
20 | /**
21 | * Unique ID of the scheduled match.
22 | */
23 | @SerializedName("game_id")
24 | public int matchId;
25 |
26 | /**
27 | * List of participating teams, empty if not known.
28 | */
29 | @SerializedName("teams")
30 | public TeamVO[] teamList;
31 |
32 | /**
33 | * The start time for this match, Unix timestamp.
34 | */
35 | @SerializedName("starttime")
36 | public long startTime;
37 |
38 | /**
39 | * Description of the match.
40 | */
41 | @SerializedName("comment")
42 | public String description;
43 |
44 | /**
45 | * Whether this is a final match or not.
46 | */
47 | @SerializedName("final")
48 | public boolean finalMatch;
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/players/BasePlayerVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo.players;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Basic player details.
7 | *
8 | * @author Wijnand
9 | */
10 | public class BasePlayerVO {
11 |
12 | /**
13 | * 32 bit Steam account number.
14 | * NOTE: This will be set to -1 for users who don't share their DotA 2 history!
15 | */
16 | @SerializedName("account_id")
17 | public int accountId;
18 |
19 | /**
20 | * Numeric ID of the hero that the player used.
21 | */
22 | @SerializedName("hero_id")
23 | public int heroId;
24 |
25 | /**
26 | * @return boolean - Whether or not this is an anonymous player.
27 | */
28 | public boolean isAnonymous() {
29 | return accountId < 0;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/players/LiveLeaguePlayerVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo.players;
2 |
3 | import nl.ansuz.android.steam.dota.vo.PickBanVO;
4 |
5 | import com.google.gson.annotations.SerializedName;
6 |
7 | /**
8 | * Player in a live league match.
9 | *
10 | * @author Wijnand
11 | */
12 | public class LiveLeaguePlayerVO extends BasePlayerVO {
13 |
14 | /**
15 | * The player's display name.
16 | */
17 | @SerializedName("name")
18 | public String name;
19 |
20 | /**
21 | * What team the player is currently playing as.
22 | *
23 | * 0 - Radiant
24 | * 1 - Dire
25 | * 2 - Broadcaster
26 | * 4 - Unassigned
27 | */
28 | @SerializedName("team")
29 | public int team;
30 |
31 | /**
32 | * @return The enumeration value of the team.
33 | */
34 | public PickBanVO.Team getTeam() {
35 | return PickBanVO.Team.fromInteger(team);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/dota/vo/team/BaseTeamDetailsVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.vo.team;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Basic team details. Part that can be directly parsed by GSON.
7 | *
8 | * @author Wijnand
9 | */
10 | public class BaseTeamDetailsVO {
11 |
12 | /**
13 | * The team's unique ID.
14 | */
15 | @SerializedName("team_id")
16 | public int teamId;
17 |
18 | /**
19 | * The team's name.
20 | */
21 | @SerializedName("name")
22 | public String name;
23 |
24 | /**
25 | * The team's tag.
26 | */
27 | @SerializedName("tag")
28 | public String tag;
29 |
30 | /**
31 | * Unix timestamp of when the team was created.
32 | */
33 | @SerializedName("time_created")
34 | public int timeCreated;
35 |
36 | /**
37 | * The UGC id for the team logo. You can resolve this with the GetUGCFileDetails method.
38 | */
39 | @SerializedName("logo")
40 | public long logo;
41 |
42 | /**
43 | * The UGC id for the team sponsor logo. You can resolve this with the GetUGCFileDetails method.
44 | */
45 | @SerializedName("logo_sponsor")
46 | public long logoSponsor;
47 |
48 | /**
49 | * The team's ISO 3166-1 country-code.
50 | */
51 | @SerializedName("country_code")
52 | public String countryCode;
53 |
54 | /**
55 | * The URL the team provided upon creation.
56 | */
57 | @SerializedName("url")
58 | public String url;
59 |
60 | /**
61 | * Amount of matches played with the current roster
62 | */
63 | @SerializedName("games_played_with_current_roster")
64 | public int gamesPlayed;
65 |
66 | /**
67 | * 32-bit account ID of the team's admin.
68 | */
69 | @SerializedName("admin_account_id")
70 | public String adminAccountId;
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/request/ISteamRequest.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.request;
2 |
3 | import java.util.Map;
4 |
5 | public interface ISteamRequest {
6 |
7 | /**
8 | * Creates a Steam API request.
9 | *
10 | * @param applicationId The application ID to make the request for.
11 | * @param params The request specific parameters.
12 | */
13 | String createRequestUrl(int applicationId, Map params);
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/request/SteamRequest.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.request;
2 |
3 | import java.util.Map;
4 |
5 | /**
6 | * Abstract class to help creating Steam API requests.
7 | *
8 | * @author Wijnand
9 | */
10 | public abstract class SteamRequest implements ISteamRequest {
11 |
12 | public final static String API_BASE_PATH = "https://api.steampowered.com";
13 | public final static String API_VERSION_ONE = "v1";
14 | public final static String API_VERSION_TWO = "v2";
15 |
16 | /**
17 | * Simple listing of available request parameters.
18 | */
19 | public class Parameter {
20 | public final static String API_KEY = "key";
21 | }
22 |
23 | /**
24 | * Constructs the base url path for this request.
25 | *
26 | * @param appId The Steam application id to use.
27 | */
28 | protected String getBaseUrl(int appId) {
29 | return API_BASE_PATH;
30 | }
31 |
32 | /**
33 | * Serializes a URL with the parameters.
34 | *
35 | * @param url The URL to add the parameters to.
36 | * @param params The parameters to add.
37 | */
38 | protected String serializeURL(String url, Map params) {
39 | url += "?";
40 | url += serializeParams(params);
41 |
42 | return url;
43 | }
44 |
45 | /**
46 | * Serializes the passed in parameters Map.
47 | *
48 | * @param params The parameters to serialize.
49 | */
50 | protected String serializeParams(Map params) {
51 | String parameters = "";
52 |
53 | if (params != null && !params.isEmpty()) {
54 | for (String key : params.keySet()) {
55 | parameters += "&" + key + "=" + params.get(key);
56 | }
57 |
58 | // Remove extra ampersand from front
59 | parameters = parameters.substring(1);
60 | }
61 |
62 | return parameters;
63 | }
64 |
65 | @Override
66 | public String createRequestUrl(int applicationId, Map params) {
67 | return serializeURL(getBaseUrl(applicationId), params);
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/request/economy/EconomyRequest.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.request.economy;
2 |
3 | import nl.ansuz.android.steam.request.ISteamRequest;
4 | import nl.ansuz.android.steam.request.SteamRequest;
5 |
6 | /**
7 | * Base class to construct any economy related request.
8 | *
9 | * @author Wijnand
10 | */
11 | public class EconomyRequest extends SteamRequest implements ISteamRequest {
12 |
13 | private final static String INTERFACE_PREFIX = "IEconItems_";
14 |
15 | /**
16 | * Builds the full interface name.
17 | *
18 | * @param applicationId The application to use this interface for.
19 | */
20 | protected String getInterface(int applicationId) {
21 | return INTERFACE_PREFIX + applicationId;
22 | }
23 |
24 | @Override
25 | protected String getBaseUrl(int appId) {
26 | String baseUrl = super.getBaseUrl(appId);
27 | baseUrl += "/" + getInterface(appId);
28 |
29 | return baseUrl;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/request/economy/GetPlayerItems.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.request.economy;
2 |
3 | import nl.ansuz.android.steam.request.ISteamRequest;
4 |
5 | /**
6 | * Helps constructing the url to retreive a player's items for a game.
7 | *
8 | * @author Wijnand
9 | */
10 | public class GetPlayerItems extends EconomyRequest implements ISteamRequest {
11 |
12 | /**
13 | * Simple listing of available request parameters.
14 | */
15 | public class Parameter {
16 | public final static String LANGUAGE = "language";
17 |
18 | /**
19 | * 64-bit Steam id.
20 | */
21 | public final static String STEAMID = "steamid";
22 | }
23 |
24 | private final static String METHOD_NAME = "GetPlayerItems";
25 |
26 | @Override
27 | protected String getBaseUrl(int appId) {
28 | String baseUrl = super.getBaseUrl(appId);
29 | baseUrl += "/" + METHOD_NAME;
30 | baseUrl += "/" + API_VERSION_ONE;
31 | baseUrl += "/";
32 |
33 | return baseUrl;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/request/economy/GetSchema.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.request.economy;
2 |
3 | import nl.ansuz.android.steam.request.ISteamRequest;
4 |
5 | /**
6 | * Helps constructing the url to retreive a game's economy schema.
7 | *
8 | * @author Wijnand
9 | */
10 | public class GetSchema extends EconomyRequest implements ISteamRequest {
11 |
12 | /**
13 | * Simple listing of available request parameters.
14 | */
15 | public class Parameter {
16 | public final static String LANGUAGE = "language";
17 | }
18 |
19 | private final static String METHOD_NAME = "GetSchema";
20 |
21 | @Override
22 | protected String getBaseUrl(int appId) {
23 | String baseUrl = super.getBaseUrl(appId);
24 | baseUrl += "/" + METHOD_NAME;
25 | baseUrl += "/" + API_VERSION_ONE;
26 | baseUrl += "/";
27 |
28 | return baseUrl;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/request/remotestorage/GetUGCFileDetails.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.request.remotestorage;
2 |
3 | import nl.ansuz.android.steam.request.ISteamRequest;
4 | import nl.ansuz.android.steam.request.SteamRequest;
5 |
6 | /**
7 | * UGC file size, local filename, and URL.
8 | *
9 | * @author Wijnand Warren
10 | */
11 | public class GetUGCFileDetails extends SteamRequest implements ISteamRequest {
12 |
13 | /**
14 | * Simple listing of available request parameters.
15 | */
16 | public class Parameter {
17 | /**
18 | * (Optional) If specified, only returns details if the file is owned by the SteamID specified.
19 | */
20 | public final static String STEAM_ID = "steamid";
21 |
22 | /**
23 | * ID of UGC file to get info for.
24 | */
25 | public final static String UGC_ID = "ugcid";
26 |
27 | /**
28 | * Application ID of product.
29 | */
30 | public final static String APP_ID = "appid";
31 | }
32 |
33 | private final static String METHOD_NAME = "GetUGCFileDetails";
34 | private final static String INTERFACE_PREFIX = "ISteamRemoteStorage";
35 |
36 | protected String getInterface(int applicationId) {
37 | return INTERFACE_PREFIX;
38 | }
39 |
40 | @Override
41 | protected String getBaseUrl(int appId) {
42 | String baseUrl = super.getBaseUrl(appId);
43 | baseUrl += "/" + getInterface(appId);
44 | baseUrl += "/" + METHOD_NAME;
45 | baseUrl += "/" + API_VERSION_ONE;
46 | baseUrl += "/";
47 |
48 | return baseUrl;
49 | }
50 | }
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/request/user/GetPlayerSummaries.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.request.user;
2 |
3 | import nl.ansuz.android.steam.request.ISteamRequest;
4 |
5 | /**
6 | * Helps constructing the URL to retrieve a user's (or multiple users') Steam
7 | * details.
8 | *
9 | * @author Wijnand
10 | */
11 | public class GetPlayerSummaries extends UserRequest implements ISteamRequest {
12 |
13 | /**
14 | * Simple listing of available request parameters.
15 | */
16 | public class Parameter {
17 | /**
18 | * Comma-delimited list of 64 bit Steam IDs to return profile
19 | * information for. Up to 100 Steam IDs can be requested.
20 | */
21 | public final static String STEAM_IDS = "steamids";
22 | }
23 |
24 | public final static String METHOD_NAME = "GetPlayerSummaries";
25 |
26 | @Override
27 | protected String getBaseUrl(int appId) {
28 | String baseUrl = super.getBaseUrl(appId);
29 | baseUrl += "/" + METHOD_NAME;
30 | baseUrl += "/" + API_VERSION_TWO;
31 | baseUrl += "/";
32 |
33 | return baseUrl;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/request/user/ResolveVanityUrl.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.request.user;
2 |
3 | import nl.ansuz.android.steam.request.ISteamRequest;
4 |
5 | /**
6 | * Helps constructing the URL to retrieve a player's Steam id based on the
7 | * vanity URL.
8 | *
9 | * @see http://wiki.teamfortress.com/wiki/WebAPI/ResolveVanityURL
10 | * @author Wijnand
11 | */
12 | public class ResolveVanityUrl extends UserRequest implements ISteamRequest {
13 |
14 | /**
15 | * Simple listing of available request parameters.
16 | */
17 | public class Parameter {
18 | /**
19 | * The vanity URL part of a user's Steam profile URL. This is the
20 | * basename of http://steamcommunity.com/id/ URLs.
21 | */
22 | public final static String VANITY_URL = "vanityurl";
23 | }
24 |
25 | private final static String METHOD_NAME = "ResolveVanityUrl";
26 |
27 | @Override
28 | protected String getBaseUrl(int appId) {
29 | String baseUrl = super.getBaseUrl(appId);
30 | baseUrl += "/" + METHOD_NAME;
31 | baseUrl += "/" + API_VERSION_ONE;
32 | baseUrl += "/";
33 |
34 | return baseUrl;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/request/user/UserRequest.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.request.user;
2 |
3 | import nl.ansuz.android.steam.request.ISteamRequest;
4 | import nl.ansuz.android.steam.request.SteamRequest;
5 |
6 | /**
7 | * Base class to construct any user related request.
8 | *
9 | * @author Wijnand
10 | */
11 | public class UserRequest extends SteamRequest implements ISteamRequest {
12 |
13 | private final static String INTERFACE_NAME = "ISteamUser";
14 |
15 | /**
16 | * Builds the full interface name.
17 | *
18 | * @param applicationId The application to use this interface for.
19 | */
20 | protected String getInterface(int applicationId) {
21 | return INTERFACE_NAME;
22 | }
23 |
24 | @Override
25 | protected String getBaseUrl(int appId) {
26 | String baseUrl = super.getBaseUrl(appId);
27 | baseUrl += "/" + getInterface(appId);
28 |
29 | return baseUrl;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/response/economy/GetSchemaResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.response.economy;
2 |
3 | import nl.ansuz.android.steam.vo.economy.ItemOriginNamesVO;
4 | import nl.ansuz.android.steam.vo.economy.ItemQualityNamesVO;
5 | import nl.ansuz.android.steam.vo.economy.ItemQualityVO;
6 | import nl.ansuz.android.steam.vo.economy.ItemSetVO;
7 | import nl.ansuz.android.steam.vo.economy.ItemVO;
8 | import nl.ansuz.android.steam.vo.economy.ParticleVO;
9 | import nl.ansuz.android.steam.vo.economy.SchemaAttributeVO;
10 |
11 | import com.google.gson.annotations.SerializedName;
12 |
13 | /**
14 | * Response object for the GetSchema request.
15 | *
16 | * @see http://wiki.teamfortress.com/wiki/WebAPI/GetSchema
17 | * @author Wijnand Warren
18 | */
19 | public class GetSchemaResponse {
20 |
21 | /**
22 | * The status of the request, should always be 1.
23 | */
24 | @SerializedName("status")
25 | public int status;
26 |
27 | /**
28 | * A string containing the URL to the full item schema as used by the game.
29 | */
30 | @SerializedName("items_game_url")
31 | public int itemsGameUrl;
32 |
33 | /**
34 | * An object containing the numeric values corresponding to each "quality"
35 | * an item can have.
36 | */
37 | @SerializedName("qualities")
38 | public ItemQualityVO qualities;
39 |
40 | /**
41 | * If the language argument is specified this object is included in the
42 | * output. It includes the translations of the internal quality names to the
43 | * specified language.
44 | */
45 | @SerializedName("qualityNames")
46 | public ItemQualityNamesVO qualityNames;
47 |
48 | /**
49 | * A list of objects describing an item's origin.
50 | */
51 | @SerializedName("originNames")
52 | public ItemOriginNamesVO[] originNames;
53 |
54 | /**
55 | * A list of item objects.
56 | */
57 | @SerializedName("items")
58 | public ItemVO[] items;
59 |
60 | /**
61 | * An object containing an array of attributes.
62 | */
63 | @SerializedName("attributes")
64 | public SchemaAttributeVO[] attributes;
65 |
66 | /**
67 | * A list of objects containing item set definitions.
68 | */
69 | @SerializedName("item_sets")
70 | public ItemSetVO[] itemSets;
71 |
72 | /**
73 | * An object containing a list of objects that describe the defined particle
74 | * effects.
75 | */
76 | @SerializedName("attribute_controlled_attached_particles")
77 | public ParticleVO[] attributeControlledAttachedParticles;
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/response/remotestorage/GetUGCFileDetailsResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.response.remotestorage;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 | import nl.ansuz.android.steam.vo.ResponseStatusVO;
5 | import nl.ansuz.android.steam.vo.remotestorage.UgcFileDetailsVO;
6 |
7 | /**
8 | * Response object for the GetUGCFileDetails request.
9 | *
10 | * @author Wijnand Warren
11 | */
12 | public class GetUGCFileDetailsResponse {
13 |
14 | /**
15 | * File details.
16 | */
17 | @SerializedName("data")
18 | public UgcFileDetailsVO data;
19 |
20 | /**
21 | * Object returned on non-HTTP errors.
22 | */
23 | @SerializedName("status")
24 | public ResponseStatusVO status;
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/response/user/GetPlayerSummariesResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.response.user;
2 |
3 | import nl.ansuz.android.steam.vo.user.UserVO;
4 |
5 | import com.google.gson.annotations.SerializedName;
6 |
7 | /**
8 | * Response object for the GetPlayerSummaries request.
9 | *
10 | * @see https://developer.valvesoftware.com/wiki/Steam_Web_API#GetPlayerSummaries_.28v0002.29
11 | * @author Wijnand
12 | */
13 | public class GetPlayerSummariesResponse {
14 |
15 | /**
16 | * List of players and their info.
17 | */
18 | @SerializedName("players")
19 | public UserVO[] players;
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/response/user/ResolveVanityUrlResponse.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.response.user;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Response object for the ResolveVanityUrl request.
7 | *
8 | * @see http://wiki.teamfortress.com/wiki/WebAPI/ResolveVanityURL
9 | * @author Wijnand
10 | */
11 | public class ResolveVanityUrlResponse {
12 |
13 | /**
14 | * The status of the request. 1 if successful, 42 if there was no match.
15 | */
16 | @SerializedName("success")
17 | private int success;
18 |
19 | /**
20 | * (Optional) The 64 bit Steam ID the vanity URL resolves to. Not returned on resolution failures.
21 | */
22 | @SerializedName("steamid")
23 | public String steamId;
24 |
25 | /**
26 | * (Optional) The message associated with the request status. Currently only used on resolution failures.
27 | */
28 | @SerializedName("message")
29 | public String message;
30 |
31 | /**
32 | * @return Whether or not the vanity URL was successfully resolved to a user id.
33 | */
34 | public boolean isSucces() {
35 | return success == 1;
36 | }
37 |
38 | /**
39 | * @return The 64 bit Steam ID parsed as a Long.
40 | */
41 | public Long getSteamIdAsLong() {
42 | return Long.parseLong(steamId);
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/util/GsonUtil.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.util;
2 |
3 | import com.google.gson.Gson;
4 | import com.google.gson.JsonElement;
5 |
6 | /**
7 | * Provides some utilities from GSON.
8 | *
9 | * @author Wijnand
10 | */
11 | public class GsonUtil {
12 |
13 | /**
14 | * Strips the "result" Object that surrounds all Dota Steam API JSON
15 | * responses.
16 | *
17 | * @param json The Steam JSON response to strip.
18 | * @return A JsonElement that can be used to deserialize the Steam API
19 | * response.
20 | */
21 | protected JsonElement getStrippedResult(String json, String elementName) {
22 | Gson gson = new Gson();
23 | JsonElement rawMatchHistoryResponse = gson.fromJson(json, JsonElement.class);
24 | JsonElement result = rawMatchHistoryResponse.getAsJsonObject().get(elementName);
25 | gson = null;
26 |
27 | return result;
28 | }
29 |
30 | /**
31 | * Strips the "result" Object that surrounds all Dota Steam API JSON
32 | * responses.
33 | *
34 | * @see getStrippedResult(String json, String elementName).
35 | * @param json The Steam JSON response to strip.
36 | */
37 | public JsonElement getStrippedDotaResult(String json) {
38 | return getStrippedResult(json, "result");
39 | }
40 |
41 | /**
42 | * Strips the "response" Object that surrounds all generic Steam API JSON
43 | * responses.
44 | *
45 | * @see getStrippedResult(String json, String elementName).
46 | * @param json The Steam JSON response to strip.
47 | */
48 | public JsonElement getStrippedSteamResult(String json) {
49 | return getStrippedResult(json, "response");
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/util/SteamIdSolver.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.util;
2 |
3 | import nl.ansuz.android.steam.SteamId;
4 |
5 | /**
6 | * Tries to determine what kind of Steam ID we're dealing with, or perhaps none at all.
7 | *
8 | * @author Wijnand
9 | */
10 | public class SteamIdSolver {
11 |
12 | /**
13 | * List of different types of Steam IDs.
14 | *
15 | * @author Wijnand
16 | */
17 | public enum IdType {
18 | UNKNOWN,
19 | TEXTUAL,
20 | ACCOUNT_32_BIT,
21 | ACCOUNT_64_BIT
22 | }
23 |
24 | /**
25 | * Determines whether or not the passed in String represents a textual Steam ID.
26 | *
27 | * @param raw The raw (input) String to analyze.
28 | */
29 | private boolean isTextualId(String raw) {
30 | boolean isTextual = false;
31 |
32 | if(raw.startsWith(SteamId.TEXTUAL_PREFIX) && raw.split(SteamId.TEXTUAL_SEPARATOR).length == 2) {
33 | isTextual = true;
34 | }
35 |
36 | return isTextual;
37 | }
38 |
39 | /**
40 | * Determines whether or not the passed in String represents a 32 bit Steam ID (a.k.a account number).
41 | *
42 | * NOTE: This might resolve to true when a 64 bit ID is passed in!
43 | *
44 | * @param raw The raw (input) String to analyze.
45 | */
46 | private boolean is32BitId(String raw) {
47 | boolean is32Bit = false;
48 | int id = -1;
49 |
50 | try {
51 | id = Integer.parseInt(raw);
52 | if(id >= 0) {
53 | is32Bit = true;
54 | }
55 | } catch (NumberFormatException e) {
56 | // Nopes, not a 32 bit ID.
57 | }
58 |
59 | return is32Bit;
60 | }
61 |
62 | /**
63 | * Determines whether or not the passed in String represents a 64 bit Steam ID.
64 | *
65 | * @param raw The raw (input) String to analyze.
66 | */
67 | private boolean is64BitId(String raw) {
68 | boolean is64Bit = false;
69 | long id = -1;
70 |
71 | try {
72 | id = Long.parseLong(raw);
73 | if(id > SteamId.ACCOUNT_TO_ID_OFFSET) {
74 | is64Bit = true;
75 | }
76 | } catch (NumberFormatException e) {
77 | // Nopes, not a 64 bit ID.
78 | }
79 |
80 | return is64Bit;
81 | }
82 |
83 | /**
84 | * Tries to identify what Steam ID type we're dealing with.
85 | *
86 | * @param raw The raw (input) String to analyze.
87 | */
88 | public IdType getIdType(String raw) {
89 | IdType type = IdType.UNKNOWN;
90 |
91 | if(isTextualId(raw)) {
92 | type = IdType.TEXTUAL;
93 | } else if(is64BitId(raw)) {
94 | type = IdType.ACCOUNT_64_BIT;
95 | } else if(is32BitId(raw)) {
96 | type = IdType.ACCOUNT_32_BIT;
97 | }
98 |
99 | return type;
100 | }
101 |
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/ResponseStatusVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Steam response status.
7 | *
8 | * @author Wijnand Warren
9 | */
10 | public class ResponseStatusVO {
11 |
12 | /**
13 | * Integer identifying error that occurred.
14 | *
15 | * 9 - The file with the given ID was not found.
16 | */
17 | @SerializedName("code")
18 | public int code;
19 |
20 | }
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/economy/ItemAttributeVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | *
7 | * @author Wijnand Warren
8 | */
9 | public class ItemAttributeVO {
10 |
11 | @SerializedName("name")
12 | public boolean name;
13 |
14 | @SerializedName("class")
15 | public String className;
16 |
17 | @SerializedName("value")
18 | public double value;
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/economy/ItemCapabilitiesVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | *
7 | * @author Wijnand Warren
8 | */
9 | public class ItemCapabilitiesVO {
10 |
11 | @SerializedName("can_craft_mark")
12 | public boolean canCraftMark;
13 |
14 | @SerializedName("can_be_restored")
15 | public boolean canBeRestored;
16 |
17 | @SerializedName("strange_parts")
18 | public boolean strangeParts;
19 |
20 | @SerializedName("paintable_unusual")
21 | public boolean paintableUnusual;
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/economy/ItemOriginNamesVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | *
7 | * @author Wijnand Warren
8 | */
9 | public class ItemOriginNamesVO {
10 |
11 | @SerializedName("origin")
12 | public int origin;
13 |
14 | @SerializedName("name")
15 | public String name;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/economy/ItemQualityNamesVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | *
7 | * @author Wijnand Warren
8 | */
9 | public class ItemQualityNamesVO {
10 |
11 | @SerializedName("normal")
12 | public String normal;
13 |
14 | @SerializedName("genuine")
15 | public String genuine;
16 |
17 | @SerializedName("vStringage")
18 | public String vStringage;
19 |
20 | @SerializedName("unusual")
21 | public String unusual;
22 |
23 | @SerializedName("unique")
24 | public String unique;
25 |
26 | @SerializedName("community")
27 | public String community;
28 |
29 | @SerializedName("developer")
30 | public String developer;
31 |
32 | @SerializedName("selfmade")
33 | public String selfmade;
34 |
35 | @SerializedName("customized")
36 | public String customized;
37 |
38 | @SerializedName("strange")
39 | public String strange;
40 |
41 | @SerializedName("completed")
42 | public String completed;
43 |
44 | @SerializedName("haunted")
45 | public String haunted;
46 |
47 | @SerializedName("tournament")
48 | public String tournament;
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/economy/ItemQualityVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | *
7 | * @author Wijnand Warren
8 | */
9 | public class ItemQualityVO {
10 |
11 | @SerializedName("normal")
12 | public int normal;
13 |
14 | @SerializedName("genuine")
15 | public int genuine;
16 |
17 | @SerializedName("vintage")
18 | public int vintage;
19 |
20 | @SerializedName("unusual")
21 | public int unusual;
22 |
23 | @SerializedName("unique")
24 | public int unique;
25 |
26 | @SerializedName("community")
27 | public int community;
28 |
29 | @SerializedName("developer")
30 | public int developer;
31 |
32 | @SerializedName("selfmade")
33 | public int selfmade;
34 |
35 | @SerializedName("customized")
36 | public int customized;
37 |
38 | @SerializedName("strange")
39 | public int strange;
40 |
41 | @SerializedName("completed")
42 | public int completed;
43 |
44 | @SerializedName("haunted")
45 | public int haunted;
46 |
47 | @SerializedName("tournament")
48 | public int tournament;
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/economy/ItemSetVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | *
7 | * @author Wijnand Warren
8 | */
9 | public class ItemSetVO {
10 |
11 | @SerializedName("item_set")
12 | public String itemSetId;
13 |
14 | @SerializedName("name")
15 | public String name;
16 |
17 | /**
18 | * String Array of ItemVO.name.
19 | */
20 | @SerializedName("items")
21 | public String[] items;
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/economy/ItemToolVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | *
7 | * @author Wijnand Warren
8 | */
9 | public class ItemToolVO {
10 |
11 | @SerializedName("type")
12 | public String type;
13 |
14 | @SerializedName("use_string")
15 | public String useString;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/economy/ItemVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Representation of a Steam Economy item.
7 | *
8 | * @author Wijnand Warren
9 | */
10 | public class ItemVO {
11 |
12 | @SerializedName("name")
13 | public String name;
14 |
15 | @SerializedName("defindex")
16 | public int defindex;
17 |
18 | @SerializedName("item_class")
19 | public String itemClass;
20 |
21 | @SerializedName("item_type_name")
22 | public String itemTypeName;
23 |
24 | @SerializedName("item_name")
25 | public String itemName;
26 |
27 | @SerializedName("proper_name")
28 | public boolean properName;
29 |
30 | /**
31 | * Match this with ItemQualityVO and ItemQualityNamesVO.
32 | * TODO: Create a util to map int to String?
33 | */
34 | @SerializedName("item_quality")
35 | public int itemQuality;
36 |
37 | @SerializedName("image_inventory")
38 | public String imageInventory;
39 |
40 | @SerializedName("min_ilevel")
41 | public int minILevel;
42 |
43 | @SerializedName("max_ilevel")
44 | public int maxILevel;
45 |
46 | @SerializedName("image_url")
47 | public String imageUrl;
48 |
49 | @SerializedName("image_url_large")
50 | public String imageUrlLarge;
51 |
52 | @SerializedName("capabilities")
53 | public ItemCapabilitiesVO capabilities;
54 |
55 | @SerializedName("tool")
56 | public ItemToolVO tool;
57 |
58 | @SerializedName("attributes")
59 | public ItemAttributeVO[] attributes;
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/economy/ParticleVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | *
7 | * @author Wijnand Warren
8 | */
9 | public class ParticleVO {
10 |
11 | @SerializedName("system")
12 | public String system;
13 |
14 | @SerializedName("id")
15 | public int id;
16 |
17 | @SerializedName("attach_to_rootbone")
18 | public boolean attachToRootbone;
19 |
20 | @SerializedName("name")
21 | public String name;
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/economy/SchemaAttributeVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.economy;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | *
7 | * @author Wijnand Warren
8 | */
9 | public class SchemaAttributeVO {
10 |
11 | @SerializedName("name")
12 | public String name;
13 |
14 | @SerializedName("defindex")
15 | public int defindex;
16 |
17 | @SerializedName("attribute_class")
18 | public String attributeClass;
19 |
20 | @SerializedName("min_value")
21 | public double minValue;
22 |
23 | @SerializedName("max_value")
24 | public double maxValue;
25 |
26 | @SerializedName("description_string")
27 | public String descriptionString;
28 |
29 | @SerializedName("description_format")
30 | public String descriptionFormat;
31 |
32 | @SerializedName("effect_type")
33 | public String effectType;
34 |
35 | @SerializedName("hidden")
36 | public boolean hidden;
37 |
38 | @SerializedName("stored_as_integer")
39 | public boolean storedAsInteger;
40 | }
41 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/remotestorage/UgcFileDetailsVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.remotestorage;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Steam remote storage (UGC) file details.
7 | *
8 | * @author Wijnand Warren
9 | */
10 | public class UgcFileDetailsVO {
11 |
12 | /**
13 | * Path to the file along with its name.
14 | */
15 | @SerializedName("filename")
16 | public String fileName;
17 |
18 | /**
19 | * URL to the file.
20 | */
21 | @SerializedName("url")
22 | public String url;
23 |
24 | /**
25 | * Size of the file.
26 | */
27 | @SerializedName("size")
28 | public int size;
29 | }
30 |
--------------------------------------------------------------------------------
/src/nl/ansuz/android/steam/vo/user/UserVO.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.vo.user;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | /**
6 | * Representation of a Steam user
7 | *
8 | * @author Wijnand
9 | */
10 | public class UserVO {
11 |
12 | /**
13 | * Valid user states.
14 | *
15 | * If the player's profile is private, this will always be "0", except if
16 | * the user has set his status to looking to trade or looking to play,
17 | * because a bug makes those status appear even if the profile is private.
18 | *
19 | * @author Wijnand
20 | */
21 | public enum PersonaState {
22 | OFFLINE,
23 | ONLINE,
24 | BUSY,
25 | AWAY,
26 | SNOOZE,
27 | LOOKING_TO_TRADE,
28 | LOOKING_TO_PLAY;
29 | }
30 |
31 | /**
32 | * Community visibility states.
33 | *
34 | * @author Wijnand
35 | */
36 | public enum CommunityState {
37 | PRIVATE,
38 | FRIENDS_ONLY,
39 | FRIENDS_OF_FRIENDS,
40 | USERS_ONLY,
41 | PUBLIC
42 | }
43 |
44 | // ======================
45 | // PUBLIC USER DATA
46 | // ======================
47 |
48 | /**
49 | * 64bit SteamID of the user.
50 | */
51 | @SerializedName("steamid")
52 | public String steamId;
53 |
54 | /**
55 | * The player's persona name (display name).
56 | */
57 | @SerializedName("personaname")
58 | public String personaName;
59 |
60 | /**
61 | * The full URL of the player's Steam Community profile.
62 | */
63 | @SerializedName("profileurl")
64 | public String profileUrl;
65 |
66 | /**
67 | * The full URL of the player's 32x32px avatar. If the user hasn't
68 | * configured an avatar, this will be the default ? avatar.
69 | */
70 | @SerializedName("avatar")
71 | public String avatar;
72 |
73 | /**
74 | * The full URL of the player's 64x64px avatar. If the user hasn't
75 | * configured an avatar, this will be the default ? avatar.
76 | */
77 | @SerializedName("avatarmedium")
78 | public String avatarMedium;
79 |
80 | /**
81 | * The full URL of the player's 184x184px avatar. If the user hasn't
82 | * configured an avatar, this will be the default ? avatar.
83 | */
84 | @SerializedName("avatarfull")
85 | public String avatarFull;
86 |
87 | /**
88 | * The user's current status.
89 | */
90 | @SerializedName("personastate")
91 | public PersonaState personaState;
92 |
93 | /**
94 | * The effective visibility state from the account making the request to the
95 | * account being viewed given the requesting account's relationship to the
96 | * viewed account.
97 | */
98 | @SerializedName("communityvisibilitystate")
99 | public CommunityState communityVisibilityState;
100 |
101 | /**
102 | * If set, indicates the user has a community profile configured (will be
103 | * set to "1").
104 | */
105 | @SerializedName("profilestate")
106 | public int profileState;
107 |
108 | /**
109 | * The last time the user was online, in unix time.
110 | */
111 | @SerializedName("lastlogoff")
112 | public int lastLogOff;
113 |
114 | /**
115 | * If set, indicates the profile allows public comments.
116 | */
117 | @SerializedName("commentpermission")
118 | public int commentPermission;
119 |
120 | // ======================
121 | // PRIVATE USER DATA
122 | // ======================
123 |
124 | /**
125 | * The player's "Real Name", if they have set it.
126 | */
127 | @SerializedName("realname")
128 | public String realName;
129 |
130 | /**
131 | * The player's primary group, as configured in their Steam Community
132 | * profile.
133 | */
134 | @SerializedName("primaryclanid")
135 | public String primaryClanId;
136 |
137 | /**
138 | * The time the player's account was created.
139 | */
140 | @SerializedName("timecreated")
141 | public int timeCreated;
142 |
143 | /**
144 | * If the user is currently in-game, this value will be returned and set to
145 | * the "gameid" of that game.
146 | */
147 | @SerializedName("gameid")
148 | public int gameId;
149 |
150 | /**
151 | * The ip and port of the game server the user is currently playing on, if
152 | * they are playing on-line in a game using Steam matchmaking. Otherwise
153 | * will be set to "0.0.0.0:0".
154 | */
155 | @SerializedName("gameserverip")
156 | public String gameServerIp;
157 |
158 | /**
159 | * If the user is currently in-game, this will be the name of the game they
160 | * are playing. This may be the name of a non-Steam game shortcut.
161 | */
162 | @SerializedName("gameextrainfo")
163 | public String gameExtraInfo;
164 |
165 | /**
166 | * If set on the user's Steam Community profile, the user's country of
167 | * residence, 2-character ISO country code.
168 | */
169 | @SerializedName("loccountrycode")
170 | public String locationCountryCode;
171 |
172 | /**
173 | * If set on the user's Steam Community profile, the user's state of
174 | * residence.
175 | */
176 | @SerializedName("locstatecode")
177 | public String locationStateCode;
178 |
179 | /**
180 | * An internal code indicating the user's city of residence. A future update
181 | * will provide this data in a more useful way.
182 | */
183 | @SerializedName("loccityid")
184 | public int locationCityId;
185 |
186 | }
187 |
--------------------------------------------------------------------------------
/tools/abilityparser/AbilitiesParser.cfg:
--------------------------------------------------------------------------------
1 | [Abilities]
2 | dotaAbilitiesFile: npc_abilities.txt
3 |
4 | [Java]
5 | template: AbilityList.java
6 | target: ..\..\src\nl\ansuz\android\steam\dota\util\heroes\AbilityList.java
7 | abilitiesToken: @@injectAbilities@@
8 | abilityCountToken: @@injectAbilityCount@@
--------------------------------------------------------------------------------
/tools/abilityparser/AbilitiesParser.py:
--------------------------------------------------------------------------------
1 | import ConfigParser
2 | import os
3 | import re
4 | """
5 | Simple tool to parse the DotA2 npc_abilities.txt file and spit out a Java class that lists all abilities.
6 |
7 | At the time of writing, only the "meepo_poof" is causing a small issue as its "AbilityBehavior" value contained
8 | double pipes ("|") between the values. Either manually remove the double pipe in the text file OR fix the Java
9 | class that this script spits out.
10 | """
11 | class AbilitiesParser:
12 |
13 | # Misc
14 | abilityCountOffset = 5001;
15 |
16 | # Config
17 | dotaAbilitiesFile = ""
18 | javaTemplateLocation = ""
19 | javaTargetLocation = ""
20 | abilitiesToken = ""
21 | abilityCountToken = ""
22 |
23 | # Item parsing
24 | abilitiesContents = ""
25 | javaTemplate = ""
26 | javaOutput = ""
27 | compiledOpenPattern = None
28 | compiledClosePattern = None
29 |
30 | def __init__(self):
31 | print "=================================="
32 | print "= DotA hero abilities parser ="
33 | print "=================================="
34 |
35 | self.compiledOpenPattern = re.compile("^\t//==================================", re.DOTALL | re.MULTILINE)
36 | self.compiledClosePattern = re.compile("^\t}$", re.DOTALL | re.MULTILINE)
37 |
38 | self.loadConfig();
39 | self.loadAbilitiesFile();
40 | self.loadJavaTemplate();
41 | self.parseAllAbilities();
42 | self.saveJavaFile();
43 |
44 | """
45 | Loads and parses the config file for the item parser.
46 | """
47 | def loadConfig(self):
48 | print "loadConfig():"
49 |
50 | config = ConfigParser.ConfigParser()
51 | file = open("AbilitiesParser.cfg")
52 | config.readfp(file)
53 | file.close()
54 |
55 | self.dotaAbilitiesFile = config.get("Abilities", "dotaAbilitiesFile")
56 | self.javaTemplateLocation = config.get("Java", "template")
57 | self.javaTargetLocation = config.get("Java", "target")
58 | self.abilitiesToken = config.get("Java", "abilitiesToken")
59 | self.abilityCountToken = config.get("Java", "abilityCountToken")
60 |
61 | print " - Abilities file: " + self.dotaAbilitiesFile
62 | print " - Java template: " + self.javaTemplateLocation
63 | print " - Java target: " + self.javaTargetLocation
64 | print " - Java ability token: " + self.abilitiesToken
65 | print " - Java ability count token: " + self.abilityCountToken
66 |
67 | """
68 | Loads the DotA abilities file.
69 | """
70 | def loadAbilitiesFile(self):
71 | print "loadAbilitiesFile(): " + self.dotaAbilitiesFile
72 | file = open(self.dotaAbilitiesFile)
73 | self.abilitiesContents = file.read()
74 | file.close()
75 |
76 | """
77 | Loads the Java template.
78 | """
79 | def loadJavaTemplate(self):
80 | print "loadJavaTemplate(): " + self.javaTemplateLocation
81 | file = open(self.javaTemplateLocation)
82 | self.javaTemplate = file.read()
83 | file.close()
84 |
85 | """
86 | Parses the DotA abilities file.
87 | """
88 | def parseAllAbilities(self):
89 | print "parseAllAbilities()"
90 | abilityPosition = self.getAbilityPosition(0)
91 |
92 | while abilityPosition:
93 | abilityString = self.abilitiesContents[abilityPosition[0]:abilityPosition[1]]
94 | # Grab attrs
95 | self.javaOutput += "\t\t" + self.parseSingleAbility(abilityString) + "\n"
96 | abilityPosition = self.getAbilityPosition(abilityPosition[1])
97 |
98 | """
99 | Finds the start and end position of an ability to parse.
100 |
101 | @param startPosition: position to start searching from.
102 | """
103 | def getAbilityPosition(self, startPosition):
104 | result = None
105 |
106 | match = self.compiledOpenPattern.search(self.abilitiesContents, startPosition)
107 | if match:
108 | itemStart = match.start()
109 | match = self.compiledClosePattern.search(self.abilitiesContents, itemStart)
110 | itemEnd = match.start()
111 | result = itemStart, itemEnd
112 |
113 | return result
114 |
115 | """
116 | Parses a single hero item and returns the Java string that we need to
117 | inject.
118 |
119 | @param item: The item to parse.
120 | """
121 | def parseSingleAbility(self, item):
122 | # General
123 | abilityId = self.findPropertyValue(item, "ID", "-1")
124 | abilityName = self.findAbilityName(item, "Unknown")
125 | abilityNameToken = self.findPropertyValue(item, "AbilityName", "")
126 | abilityType = self.findPropertyValue(item, "AbilityType", "null")
127 | abilityBehavior = self.findPropertyValue(item, "AbilityBehavior", "-1")
128 | abilityOnCastbar = self.findPropertyValue(item, "OnCastbar", "-1")
129 | abilityOnLearnbar = self.findPropertyValue(item, "OnLearnbar", "-1")
130 |
131 | # Stats
132 | abilityCastRange = self.findPropertyValue(item, "AbilityCastRange", "-1")
133 | abilityCastRangeBuffer = self.findPropertyValue(item, "AbilityCastRangeBuffer", "-1")
134 | abilityCastPoint = self.findPropertyValue(item, "AbilityCastPoint", "null")
135 | abilityChannelTime = self.findPropertyValue(item, "AbilityChannelTime", "null")
136 | abilityCooldown = self.findPropertyValue(item, "AbilityCooldown", "null")
137 | abilityDuration = self.findPropertyValue(item, "AbilityDuration", "null")
138 | abilitySharedCooldown = self.findPropertyValue(item, "AbilitySharedCooldown", "")
139 | abilityDamage = self.findPropertyValue(item, "AbilityDamage", "null")
140 | abilityManaCost = self.findPropertyValue(item, "AbilityManaCost", "null")
141 | abilityModifierSupportValue = self.findPropertyValue(item, "AbilityModifierSupportValue", "-1")
142 | abilityModifierSupportBonus = self.findPropertyValue(item, "AbilityModifierSupportBonus", "-1")
143 |
144 | result = "addAbility(new AbilityVO("
145 | # General
146 | result += abilityId + ", "
147 | result += "\"" + abilityName + "\", "
148 | result += "\"" + abilityNameToken + "\", "
149 | result += "null, " if abilityType == "null" else "AbilityVO.Type." + abilityType + ", "
150 | result += "-1, " if abilityBehavior == "-1" else "AbilityVO.Behavior." + abilityBehavior.replace(" | ", ".behaviourValue + AbilityVO.Behavior.") + ".behaviourValue, "
151 | result += "-1, " if abilityOnCastbar == "-1" else abilityOnCastbar + ", "
152 | result += "-1, " if abilityOnLearnbar == "-1" else abilityOnLearnbar + ", "
153 |
154 | # Stats
155 | result += "null, " if abilityCastRange == "null" else "new int[]{" + abilityCastRange.replace(" ", ", ") + "}, "
156 | result += "-1, " if abilityCastRangeBuffer == "-1" else abilityCastRangeBuffer + ", "
157 | result += "null, " if abilityCastPoint == "null" else "new double[]{" + abilityCastPoint.replace(" ", ", ") + "}, "
158 | result += "null, " if abilityChannelTime == "null" else "new double[]{" + abilityChannelTime.replace(" ", ", ") + "}, "
159 | result += "null, " if abilityCooldown == "null" else "new double[]{" + abilityCooldown.replace(" ", ", ") + "}, "
160 | result += "null, " if abilityDuration == "null" else "new double[]{" + abilityDuration.replace(" ", ", ") + "}, "
161 | result += "\"" + abilitySharedCooldown + "\", "
162 | result += "null, " if abilityDamage == "null" else "new double[]{" + abilityDamage.replace(" ", ", ") + "}, "
163 | result += "null, " if abilityManaCost == "null" else "new int[]{" + abilityManaCost.replace(" ", ", ") + "}, "
164 | result += abilityModifierSupportValue + ", "
165 | result += abilityModifierSupportBonus
166 |
167 | result += "));"
168 |
169 | return result
170 |
171 | """
172 | Find a hero ability's translated name, i.e. "Blink dagger".
173 |
174 | @param item: The item to search through.
175 | @param defaultValue: Default value to use if the property (or value)
176 | can't be found.
177 | """
178 | def findAbilityName(self, item, defaultValue):
179 | result = defaultValue
180 | namePrefix = "Ability: "
181 |
182 | nameStartString = "// "
183 | nameStart = item.find(nameStartString) + len(nameStartString)
184 | nameEnd = item.find("\n", nameStart)
185 |
186 | foundName = item[nameStart:nameEnd]
187 | if len(foundName) > 0:
188 | result = foundName
189 | if namePrefix in result:
190 | result = result[len(namePrefix):len(result)]
191 |
192 | return result;
193 |
194 | """
195 | Finds a single property's value.
196 |
197 | @param item: The item to search through.
198 | @param propertyName: The property we're looking for.
199 | @param defaultValue: Default value to use if the property (or value)
200 | can't be found.
201 | """
202 | def findPropertyValue(self, item, propertyName, defaultValue):
203 | result = defaultValue
204 | namePosition = item.find(propertyName)
205 |
206 | if namePosition > -1:
207 | valueStart = item.find("\"", namePosition + len(propertyName) + 1)
208 | if valueStart > -1:
209 | valueStart += 1
210 | valueEnd = item.find("\"", valueStart)
211 | if valueEnd > -1:
212 | result = item[valueStart:valueEnd]
213 |
214 | return result
215 |
216 | """
217 | Finds the field that indicates how many IDs are already in use.
218 | """
219 | def getAbilitiesCount(self):
220 | print "getAbilitiesCount()"
221 | countIdentifier = "Next free ID "
222 |
223 | # Count is always at the end of the file.
224 | startOffset = len(self.abilitiesContents) - 200
225 | countStart = self.abilitiesContents.find(countIdentifier, startOffset)
226 | countStart += len(countIdentifier)
227 |
228 | countEnd = self.abilitiesContents.find("\n", countStart)
229 |
230 | return str(int(self.abilitiesContents[countStart:countEnd]) - self.abilityCountOffset)
231 |
232 | """
233 | Save the Java class.
234 | """
235 | def saveJavaFile(self):
236 | print "saveJavaFile(): " + self.javaTargetLocation
237 | fileOutput = self.javaTemplate.replace(self.abilitiesToken, self.javaOutput)
238 | fileOutput = fileOutput.replace(self.abilityCountToken, self.getAbilitiesCount())
239 |
240 | file = open(self.javaTargetLocation, "w")
241 | file.write(fileOutput);
242 | file.close();
243 | print "Done!"
244 |
245 | if __name__ == "__main__":
246 | AbilitiesParser()
--------------------------------------------------------------------------------
/tools/abilityparser/AbilityList.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.util.heroes;
2 |
3 | import nl.ansuz.android.steam.dota.vo.heroes.AbilityVO;
4 |
5 | /**
6 | * Auto-generated Hero ability list.
7 | *
8 | * This class gets generated by passing the DotA game file
9 | * "scripts/npc/npc_abilities.txt" that can be extracted from
10 | * "/Steam/steamapps/common/dota 2 beta/dota/pak01_dir.vpk"
11 | *
12 | * Use tools/abilityparser/AbilityParser.py to generate.
13 | *
14 | * @author Wijnand Warren
15 | */
16 | public class AbilityList {
17 |
18 | private static final int ID_OFFSET = 5001;
19 | private static final int TOTAL_ABILITIES = @@injectAbilityCount@@;
20 |
21 | private AbilityVO[] abilities;
22 |
23 | /**
24 | * CONSTRUCTOR
25 | */
26 | public AbilityList() {
27 | init();
28 | }
29 |
30 | private void init() {
31 | abilities = new AbilityVO[TOTAL_ABILITIES];
32 | populateAbilityList();
33 | }
34 |
35 | /**
36 | * Populates the abilities list.
37 | */
38 | private void populateAbilityList() {
39 | @@injectAbilities@@
40 | }
41 |
42 | /**
43 | * Adds a new ability to the list.
44 | *
45 | * @param ability AbilityVO - The ability to add to the list.
46 | */
47 | private void addAbility(AbilityVO ability) {
48 | int normalizedId = ability.id - ID_OFFSET;
49 | if (normalizedId >= 0 && normalizedId < TOTAL_ABILITIES) {
50 | abilities[normalizedId] = ability;
51 | }
52 | }
53 |
54 | /**
55 | * Retrieves an ability from the list.
56 | *
57 | * @param id int - The unique id of the ability to retrieve.
58 | * @return The ability that matches the passed in id OR null when not found.
59 | */
60 | public AbilityVO getAbilityById(int id) {
61 | int normalizedId = id - ID_OFFSET;
62 | AbilityVO ability = null;
63 | if (normalizedId >= 0 && normalizedId < TOTAL_ABILITIES) {
64 | ability = abilities[normalizedId];
65 | }
66 |
67 | return ability;
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/tools/itemparser/BuildItemsParser.cfg:
--------------------------------------------------------------------------------
1 | [Items]
2 | dotaBuildItemsFile: items.txt
3 |
4 | [Java]
5 | template: HeroBuildItemList.java
6 | target: ..\..\src\nl\ansuz\android\steam\dota\util\HeroBuildItemList.java
7 | itemsToken: @@injectItems@@
8 | itemCountToken: @@injectItemCount@@
--------------------------------------------------------------------------------
/tools/itemparser/BuildItemsParser.py:
--------------------------------------------------------------------------------
1 | import ConfigParser
2 | import os
3 | import re
4 |
5 | class BuildItemsParser:
6 |
7 | # Config
8 | dotaBuildItemsFile = ""
9 | javaTemplateLocation = ""
10 | javaTargetLocation = ""
11 | itemsToken = ""
12 | itemCountToken = ""
13 |
14 | # Item parsing
15 | itemContents = ""
16 | javaTemplate = ""
17 | javaOutput = ""
18 | compiledOpenPattern = None
19 | compiledClosePattern = None
20 |
21 | def __init__(self):
22 | print "===================================="
23 | print "= DotA hero build items parser ="
24 | print "===================================="
25 |
26 | self.compiledOpenPattern = re.compile("^\t//==================================", re.DOTALL | re.MULTILINE)
27 | self.compiledClosePattern = re.compile("^\t}$", re.DOTALL | re.MULTILINE)
28 |
29 | self.loadConfig();
30 | self.loadItemsFile();
31 | self.loadJavaTemplate();
32 | self.parseAllItems();
33 | self.saveJavaFile();
34 |
35 | """
36 | Loads and parses the config file for the item parser.
37 | """
38 | def loadConfig(self):
39 | print "loadConfig():"
40 |
41 | config = ConfigParser.ConfigParser()
42 | file = open("BuildItemsParser.cfg")
43 | config.readfp(file)
44 | file.close()
45 |
46 | self.dotaBuildItemsFile = config.get("Items", "dotaBuildItemsFile")
47 | self.javaTemplateLocation = config.get("Java", "template")
48 | self.javaTargetLocation = config.get("Java", "target")
49 | self.itemsToken = config.get("Java", "itemsToken")
50 | self.itemCountToken = config.get("Java", "itemCountToken")
51 |
52 | print " - Items file: " + self.dotaBuildItemsFile
53 | print " - Java template: " + self.javaTemplateLocation
54 | print " - Java target: " + self.javaTargetLocation
55 | print " - Java items token: " + self.itemsToken
56 | print " - Java item count token: " + self.itemCountToken
57 |
58 | """
59 | Loads the DotA items file.
60 | """
61 | def loadItemsFile(self):
62 | print "loadItemsFile(): " + self.dotaBuildItemsFile
63 | file = open(self.dotaBuildItemsFile)
64 | self.itemContents = file.read()
65 | file.close()
66 |
67 | """
68 | Loads the Java template.
69 | """
70 | def loadJavaTemplate(self):
71 | print "loadJavaTemplate(): " + self.javaTemplateLocation
72 | file = open(self.javaTemplateLocation)
73 | self.javaTemplate = file.read()
74 | file.close()
75 |
76 | """
77 | Parses the DotA items file.
78 | """
79 | def parseAllItems(self):
80 | print "parseAllItems()"
81 | # store in self.javaOutput
82 | itemPosition = self.getItemPosition(0)
83 |
84 | while itemPosition:
85 | #print " - item: %s" % (itemPosition,)
86 | itemString = self.itemContents[itemPosition[0]:itemPosition[1]]
87 | # Grab attrs
88 | self.javaOutput += "\t\t" + self.parseSingleItem(itemString) + "\n"
89 | itemPosition = self.getItemPosition(itemPosition[1])
90 |
91 | """
92 | Finds the start and end position of an item to parse.
93 |
94 | @param startPosition: position to start searching from.
95 | """
96 | def getItemPosition(self, startPosition):
97 | result = None
98 |
99 | match = self.compiledOpenPattern.search(self.itemContents, startPosition)
100 | if match:
101 | itemStart = match.start()
102 | match = self.compiledClosePattern.search(self.itemContents, itemStart)
103 | itemEnd = match.start()
104 | result = itemStart, itemEnd
105 |
106 | return result
107 |
108 | """
109 | Parses a single hero item and returns the Java string that we need to
110 | inject.
111 |
112 | @param item: The item to parse.
113 | """
114 | def parseSingleItem(self, item):
115 | abilityTranslatedName = self.findItemName(item, "Unknown")
116 | id = self.findPropertyValue(item, "ID", "-1")
117 | abilityName = self.findPropertyValue(item, "AbilityName", "")
118 | abilityBehavior = self.findPropertyValue(item, "AbilityBehavior", "-1")
119 |
120 | abilityCastRange = self.findPropertyValue(item, "AbilityCastRange", "")
121 | abilityCastPoint = self.findPropertyValue(item, "AbilityCastPoint", "-1")
122 | abilityCooldown = self.findPropertyValue(item, "AbilityCooldown", "")
123 | abilityManaCost = self.findPropertyValue(item, "AbilityManaCost", "")
124 |
125 | itemCost = self.findPropertyValue(item, "ItemCost", "-1")
126 | itemShopTags = self.findPropertyValue(item, "ItemShopTags", "")
127 | itemQuality = self.findPropertyValue(item, "ItemQuality", "")
128 | sideShop = self.findPropertyValue(item, "SideShop", "0")
129 | invalidHeroes = self.findPropertyValue(item, "InvalidHeroes", "")
130 |
131 | result = "itemList[" + id + "] = new BuildItemVO("
132 | result += id + ", "
133 | result += "\"" + abilityTranslatedName + "\", "
134 | result += "\"" + abilityName + "\", "
135 | result += "-1, " if abilityBehavior == "-1" else "AbilityVO.Behavior." + abilityBehavior.replace(" | ", ".behaviourValue + AbilityVO.Behavior.") + ".behaviourValue, "
136 |
137 | result += "null, " if abilityCastRange == "" else "new int[]{" + abilityCastRange.replace(" ", ", ") + "}, "
138 | result += abilityCastPoint + ", "
139 | result += "null, " if abilityCooldown == "" else "new double[]{" + abilityCooldown.replace(" ", ", ") + "}, "
140 | result += "null, " if abilityManaCost == "" else "new int[]{" + abilityManaCost.replace(" ", ", ") + "}, "
141 |
142 | result += itemCost + ", "
143 | result += "null, " if itemShopTags == "" else "new String[]{\"" + itemShopTags.replace(";", "\", \"") + "\"}, "
144 | result += "\"" + itemQuality + "\", "
145 | result += ("true" if sideShop == "1" else "false") + ", "
146 | result += "null" if invalidHeroes == "" else "new String[]{\"" + invalidHeroes.replace(";", "\", \"") + "\"}"
147 | result += ");"
148 |
149 | return result
150 |
151 | """
152 | Find a hero build item's translated name, i.e. "Blink dagger".
153 |
154 | @param item: The item to search through.
155 | @param defaultValue: Default value to use if the property (or value)
156 | can't be found.
157 | """
158 | def findItemName(self, item, defaultValue):
159 | result = defaultValue
160 | nameStart = item.find("// ") + 3
161 | nameEnd = item.find("//=", 4) - 2
162 |
163 | foundName = item[nameStart:nameEnd]
164 | if len(foundName) > 0:
165 | result = foundName
166 |
167 | return result;
168 |
169 | """
170 | Finds a single property's value.
171 |
172 | @param item: The item to search through.
173 | @param propertyName: The property we're looking for.
174 | @param defaultValue: Default value to use if the property (or value)
175 | can't be found.
176 | """
177 | def findPropertyValue(self, item, propertyName, defaultValue):
178 | result = defaultValue
179 | namePosition = item.find(propertyName)
180 |
181 | if namePosition > -1:
182 | valueStart = item.find("\"", namePosition + len(propertyName) + 1)
183 | if valueStart > -1:
184 | valueStart += 1
185 | valueEnd = item.find("\"", valueStart)
186 | if valueEnd > -1:
187 | result = item[valueStart:valueEnd]
188 |
189 | return result
190 |
191 | """
192 | Finds the field that indicates how many IDs are already in use.
193 | """
194 | def getItemCount(self):
195 | print "getItemCount()"
196 | countIdentifier = "// next free ID: "
197 |
198 | countStart = self.itemContents.find(countIdentifier)
199 | countStart += len(countIdentifier)
200 |
201 | countEnd = self.itemContents.find("\n", countStart)
202 |
203 | return self.itemContents[countStart:countEnd]
204 |
205 | """
206 | Save the Java class.
207 | """
208 | def saveJavaFile(self):
209 | print "saveJavaFile(): " + self.javaTargetLocation
210 | fileOutput = self.javaTemplate.replace(self.itemsToken, self.javaOutput)
211 | fileOutput = fileOutput.replace(self.itemCountToken, self.getItemCount())
212 |
213 | file = open(self.javaTargetLocation, "w")
214 | file.write(fileOutput);
215 | file.close();
216 | print "Done!"
217 |
218 | if __name__ == "__main__":
219 | BuildItemsParser()
--------------------------------------------------------------------------------
/tools/itemparser/HeroBuildItemList.java:
--------------------------------------------------------------------------------
1 | package nl.ansuz.android.steam.dota.util;
2 |
3 | import nl.ansuz.android.steam.dota.vo.BuildItemVO;
4 | import nl.ansuz.android.steam.dota.vo.heroes.AbilityVO;
5 |
6 | /**
7 | * Auto-generated Hero build item list.
8 | *
9 | * This class gets generated by passing the DotA game file
10 | * "scripts/npc/items.txt" that can be extracted from
11 | * "/Steam/steamapps/common/dota 2 beta/dota/pak01_dir.vpk"
12 | *
13 | * Use tools/itemparser/BuildItemsParser.py to generate.
14 | *
15 | * @author Wijnand
16 | */
17 | public class HeroBuildItemList {
18 |
19 | private BuildItemVO[] itemList;
20 |
21 | /**
22 | * CONSTRUCTOR
23 | */
24 | public HeroBuildItemList() {
25 | init();
26 | }
27 |
28 | /**
29 | * Initializes this class.
30 | */
31 | private void init() {
32 | createItemList();
33 | }
34 |
35 | /**
36 | * Constructs the Hero build item list.
37 | */
38 | private void createItemList() {
39 | itemList = new BuildItemVO[@@injectItemCount@@];
40 | @@injectItems@@
41 | }
42 |
43 | public BuildItemVO getItemById(int id) {
44 | BuildItemVO item = null;
45 |
46 | if(id < itemList.length) {
47 | item = itemList[id];
48 | }
49 |
50 | return item;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/tools/ti3/README.md:
--------------------------------------------------------------------------------
1 | #The International 3 - Team Matches
2 | Listings of the TI3 team matches. Matches are listed in a *.json file per day and divided by series.
3 | The JSON structure is roughly the following:
4 | ```json
5 | { "date": "date of competition day",
6 | "name": "name of the event",
7 |
8 | "series": [
9 | { "name": "series name",
10 | "a": match id,
11 | ...
12 | },
13 | ... ]
14 | }
15 | ```
16 |
17 | ##Preliminaries
18 | * [Day 00](prelims_day_00.json)
19 | * [Day 01](prelims_day_01.json)
20 | * [Day 02](prelims_day_02.json)
21 | * [Day 03](prelims_day_03.json)
22 |
23 | ##Main Event
24 | * [Day 01](main_event_day_01.json)
25 | * [Day 02](main_event_day_02.json)
26 | * [Day 03](main_event_day_03.json)
27 | * [Day 04](main_event_day_04.json)
28 | * [Day 05](main_event_day_05.json)
29 |
--------------------------------------------------------------------------------
/tools/ti3/main_event_day_01.json:
--------------------------------------------------------------------------------
1 | { "date": "Wednesday 07 08 2013",
2 | "name": "Main event day 01",
3 |
4 | "series": [
5 | { "name": "Upper Bracket Round 1A",
6 | "a": 266642819,
7 | "b": 266675550,
8 | "c": 266691076 },
9 |
10 | { "name": "Upper Bracket Round 1B",
11 | "a": 266726957,
12 | "b": 266744516 },
13 |
14 | { "name": "Lower Bracket Round 1A",
15 | "a": 266777348 },
16 |
17 | { "name": "Lower Bracket Round 1B",
18 | "a": 266803581 },
19 |
20 | { "name": "Lower Bracket Round 2A",
21 | "a": 266832024 },
22 |
23 | { "name": "Lower Bracket Round 2B",
24 | "a": 266864588 } ]
25 | }
26 |
--------------------------------------------------------------------------------
/tools/ti3/main_event_day_02.json:
--------------------------------------------------------------------------------
1 | { "date": "Thursday 08 08 2013",
2 | "name": "Main event day 02",
3 |
4 | "series": [
5 | { "name": "Upper Bracket Round 1C",
6 | "a": 267640827,
7 | "b": 267690993 },
8 |
9 | { "name": "Upper Bracket Round 1D",
10 | "a": 267725202,
11 | "b": 267750277,
12 | "c": 267795420 },
13 |
14 | { "name": "Lower Bracket Round 1C",
15 | "a": 267826531 },
16 |
17 | { "name": "Lower Bracket Round 1D",
18 | "a": 267852851 },
19 |
20 | { "name": "Lower Bracket Round 2C",
21 | "a": 267885392 },
22 |
23 | { "name": "Lower Bracket Round 2D",
24 | "a": 267921517 } ]
25 | }
26 |
--------------------------------------------------------------------------------
/tools/ti3/main_event_day_03.json:
--------------------------------------------------------------------------------
1 | { "date": "Friday 09 08 2013",
2 | "name": "Main event day 03",
3 |
4 | "series": [
5 | { "name": "Upper Bracket Round 2B",
6 | "a": 268683084,
7 | "b": 268737468,
8 | "c": 268775251 },
9 |
10 | { "name": "Upper Bracket Round 2A",
11 | "a": 268806477,
12 | "b": 268825557,
13 | "c": 268847227 },
14 |
15 | { "name": "Lower Bracket Round 3A",
16 | "a": 268881455 },
17 |
18 | { "name": "Lower Bracket Round 3B",
19 | "a": 268920193 },
20 |
21 | { "name": "Lower Bracket Round 4A 1/3",
22 | "a": 268963993 },
23 |
24 | { "name": "Lower Bracket Round 4B 1/3",
25 | "a": 269004111 } ]
26 | }
27 |
--------------------------------------------------------------------------------
/tools/ti3/main_event_day_04.json:
--------------------------------------------------------------------------------
1 | { "date": "Saturday 10 08 2013",
2 | "name": "Main event day 04",
3 |
4 | "series": [
5 | { "name": "Lower Bracket Round 4A",
6 | "b": 269739993 ,
7 | "c": 269777362 },
8 |
9 | { "name": "Lower Bracket Round 4B",
10 | "b": 269828278,
11 | "c": 269879845 },
12 |
13 | { "name": "Upper Bracket Round 3A",
14 | "a": 269910097,
15 | "b": 269927795 },
16 |
17 | { "name": "Lower Bracket Round 5A",
18 | "a": 269952489,
19 | "b": 269981681,
20 | "c": 270016993 } ]
21 | }
22 |
--------------------------------------------------------------------------------
/tools/ti3/main_event_day_05.json:
--------------------------------------------------------------------------------
1 | { "date": "Saturday 11 08 2013",
2 | "name": "Main event day 05",
3 |
4 | "series": [
5 | { "name": "Lower Bracket Round 6A",
6 | "a": 270942504 ,
7 | "b": 270979841 ,
8 | "c": 271008789 },
9 |
10 | { "name": "Grand Championship",
11 | "a": 271076032,
12 | "b": 271088718,
13 | "c": 271102834,
14 | "d": 271123757,
15 | "e": 271145478 } ]
16 | }
17 |
--------------------------------------------------------------------------------
/tools/ti3/prelims_day_00.json:
--------------------------------------------------------------------------------
1 | { "date": "Friday 02 08 2013",
2 | "name": "Prelims day 00",
3 |
4 | "series": [
5 | { "name": "Wildcard Games",
6 | "a": 261406872,
7 | "b": 261440616,
8 | "c": 261471219,
9 | "d": 261498337
10 | } ]
11 | }
12 |
--------------------------------------------------------------------------------
/tools/ti3/prelims_day_01.json:
--------------------------------------------------------------------------------
1 | { "date": "Saturday 03 08 2013",
2 | "name": "Prelims day 01",
3 |
4 | "series": [
5 | { "name": "Series 1",
6 | "a": 262276878,
7 | "b": 262281327,
8 | "c": 262283296,
9 | "d": 262279207 },
10 |
11 | { "name": "Series 2",
12 | "a": 262303778,
13 | "b": 262312446,
14 | "c": 262322091,
15 | "d": 262324734 },
16 |
17 | { "name": "Series 3",
18 | "a": 262341896,
19 | "b": 262357611,
20 | "c": 262385766,
21 | "d": 262374910 },
22 |
23 | { "name": "Series 4",
24 | "a": 262367754,
25 | "b": 262392411,
26 | "c": 262426855,
27 | "d": 262427613 },
28 |
29 | { "name": "Series 5",
30 | "a": 262411148,
31 | "b": 262445112,
32 | "c": 262467064,
33 | "d": 262457078 },
34 |
35 | { "name": "Series 6",
36 | "a": 262438280,
37 | "b": 262475417,
38 | "c": 262495365,
39 | "d": 262482014 },
40 |
41 | { "name": "Series 7",
42 | "a": 262483445,
43 | "b": 262504787,
44 | "c": 262520546,
45 | "d": 262511470 },
46 |
47 | { "name": "Series 8",
48 | "a": 262509769,
49 | "b": 262520933,
50 | "c": 262546824,
51 | "d": 262531941 },
52 |
53 | { "name": "Series 9",
54 | "a": 262535265,
55 | "b": 262561359,
56 | "c": 262579147,
57 | "d": 262559167 },
58 |
59 | { "name": "Series 10",
60 | "a": 262553182,
61 | "b": 262580105,
62 | "c": 262603145,
63 | "d": 262584768 },
64 |
65 | { "name": "Series 11",
66 | "a": 262575056,
67 | "b": 262604402,
68 | "c": 262629776,
69 | "d": 262613112 },
70 |
71 | { "name": "Series 12",
72 | "a": 262596112,
73 | "b": 262632112,
74 | "c": 262650433,
75 | "d": 262632760 } ]
76 | }
77 |
--------------------------------------------------------------------------------
/tools/ti3/prelims_day_02.json:
--------------------------------------------------------------------------------
1 | { "date": "Sunday 04 08 2013",
2 | "name": "Prelims day 02",
3 |
4 | "series": [
5 | { "name": "Series 13",
6 | "a": 263290556,
7 | "b": 263300623,
8 | "c": 263297825,
9 | "d": 263298375 },
10 |
11 | { "name": "Series 14",
12 | "a": 263328756,
13 | "b": 263344752,
14 | "c": 263346183,
15 | "d": 263335409 },
16 |
17 | { "name": "Series 15",
18 | "a": 263387356,
19 | "b": 263395326,
20 | "c": 263385734,
21 | "d": 263406210 },
22 |
23 | { "name": "Series 16",
24 | "a": 263462906,
25 | "b": 263433706,
26 | "c": 263429901,
27 | "d": 263451354 },
28 |
29 | { "name": "Series 17",
30 | "a": 263497811,
31 | "b": 263481245,
32 | "c": 263470198,
33 | "d": 263495756 },
34 |
35 | { "name": "Series 18",
36 | "a": 263525190,
37 | "b": 263532024,
38 | "c": 263494556,
39 | "d": 263526474 },
40 |
41 | { "name": "Series 19",
42 | "a": 263554917,
43 | "b": 263559744,
44 | "c": 263525880,
45 | "d": 263565113 },
46 |
47 | { "name": "Series 20",
48 | "a": 263580374,
49 | "b": 263593584,
50 | "c": 263557879,
51 | "d": 263584058 },
52 |
53 | { "name": "Series 21",
54 | "a": 263615039,
55 | "b": 263615518,
56 | "c": 263591396,
57 | "d": 263612072 },
58 |
59 | { "name": "Series 22",
60 | "a": 263632423,
61 | "b": 263633662,
62 | "c": 263615830,
63 | "d": 263639860 },
64 |
65 | { "name": "Series 23",
66 | "a": 263648410,
67 | "b": 263659844,
68 | "c": 263639362,
69 | "d": 263663368 },
70 |
71 | { "name": "Series 24",
72 | "a": 263673866,
73 | "b": 263677108,
74 | "c": 263657611,
75 | "d": 263688319 } ]
76 | }
77 |
--------------------------------------------------------------------------------
/tools/ti3/prelims_day_03.json:
--------------------------------------------------------------------------------
1 | { "date": "Monday 05 08 2013",
2 | "name": "Prelims day 03",
3 |
4 | "series": [
5 | { "name": "Series 25",
6 | "a": 264324774,
7 | "b": 264322647,
8 | "c": 264323424,
9 | "d": 264336354 },
10 |
11 | { "name": "Series 26",
12 | "a": 264360198,
13 | "b": 264368248,
14 | "c": 264360439,
15 | "d": 264386517 },
16 |
17 | { "name": "Series 27",
18 | "a": 264406768,
19 | "b": 264431672,
20 | "c": 264412165,
21 | "d": 264422834 },
22 |
23 | { "name": "Series 28",
24 | "a": 264453915,
25 | "b": 264470591,
26 | "c": 264450476,
27 | "d": 264459306 } ]
28 | }
29 |
--------------------------------------------------------------------------------