27 lines
812 B
Dart
27 lines
812 B
Dart
import 'package:faucethub/Backend/DebugHelper.dart';
|
|
import 'package:faucethub/Backend/hoarder.dart';
|
|
|
|
class Brain{
|
|
static const String API_ENDPOINT = "http://vps.playpoolstudios.com/faucet/api/";
|
|
|
|
|
|
static dynamic UserJson;
|
|
|
|
static List<dynamic> LinkedGamesJson = [];
|
|
static List<dynamic> NonLinkedGamesJson = [];
|
|
|
|
|
|
static void InitUserData(){
|
|
LinkedGamesJson = [];
|
|
NonLinkedGamesJson = [];
|
|
List<String> linkedGames = UserJson['linkedGames'].toString().split(',');
|
|
Debug.Log("Going to filter linked games from ${Hoarder.GamesJson.length} games\nmy linked game ids : ${UserJson['linkedGames']}");
|
|
Hoarder.GamesJson.forEach((game) {
|
|
if(linkedGames.contains(game['id'])){
|
|
LinkedGamesJson.add(game);
|
|
}else{
|
|
NonLinkedGamesJson.add(game);
|
|
}
|
|
});
|
|
}
|
|
} |