Skip to content

Commit

Permalink
feat: retrieve players rating, game result and time class. need to re…
Browse files Browse the repository at this point in the history
…factor and handle errors
  • Loading branch information
AmanMenda committed May 3, 2024
1 parent 68f121d commit eb05b69
Show file tree
Hide file tree
Showing 42 changed files with 19,179 additions and 12 deletions.
2 changes: 2 additions & 0 deletions Libraries/include/GamesPlayedPage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ namespace Stuckfish
Core& _app;
Logic& _logic;
UserData& _userdata;

bool _hasRetrievedGames = false;
};
}
15 changes: 9 additions & 6 deletions Libraries/include/Logic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
#include <iostream>
#include <algorithm>
#include <cpr/cpr.h>
#include "rapidjson/document.h"
#include "rapidjson/error/en.h"

namespace Stuckfish
{

enum HttpStatusCode
{
SUCCESS = 200,
UNAUTHORIZED = 401,
};
// consider creating a structure to hold games data and a vector of this structure in Logic.

class Logic
{
Expand All @@ -21,6 +18,12 @@ namespace Stuckfish
// method to fetch all the games played by the "specified" user in the month.
void GamesPlayedWithinPeriod(const std::string& username, const std::string& year, const std::string& month);
private:
std::string _whiteUsername = "";
std::string _blackUsername = "";
std::string _whiteRating = "";
std::string _blackRating = "";
std::string _gameFormat = "";
std::string _pgn = "";
};
}

Loading

0 comments on commit eb05b69

Please sign in to comment.