Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Progark gruppe 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Ingebrigt Ørstad
Progark gruppe 3
Commits
0540a341
Commit
0540a341
authored
5 years ago
by
ivarnm
Browse files
Options
Downloads
Patches
Plain Diff
#10
Add getPlayerById
parent
2fcfeee6
No related branches found
No related tags found
1 merge request
!21
Resolve "Query intermediate"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/core/src/com/gameware/game/QueryIntermediate.java
+11
-0
11 additions, 0 deletions
frontend/core/src/com/gameware/game/QueryIntermediate.java
with
11 additions
and
0 deletions
frontend/core/src/com/gameware/game/QueryIntermediate.java
+
11
−
0
View file @
0540a341
...
...
@@ -11,6 +11,7 @@ import com.badlogic.gdx.utils.JsonReader;
import
com.badlogic.gdx.utils.JsonValue
;
import
com.gameware.game.models.Game
;
import
com.gameware.game.models.Highscore
;
import
com.gameware.game.models.Player
;
import
com.gameware.game.models.Round
;
import
com.gameware.game.models.Tournament
;
...
...
@@ -244,4 +245,14 @@ public class QueryIntermediate {
}
// ---------------- Player methods ----------------
public
static
Player
getPlayerById
(
String
playerId
)
throws
IOException
,
NoSuchElementException
{
String
route
=
"players/username/"
+
playerId
;
String
[]
response
=
sendGetRequest
(
route
);
checkStatusCode
(
response
);
Player
player
=
json
.
fromJson
(
Player
.
class
,
response
[
1
].
substring
(
1
,
response
[
1
].
length
()-
1
));
checkObjectNotNull
(
player
);
return
player
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment