Commits

David Stone committed 2c26861

Moved EvaluationConstants into the generic client.

Comments (0)

Files changed (4)

source/clients/client.cpp

 
 namespace technicalmachine {
 
+void Client::reload_settings() {
+	m_evaluation_constants.load();
+}
+
 DetailedStats const & Client::detailed() const {
 	return detailed_stats;
 }
 
+Evaluate const & Client::evaluation_constants() const {
+	return m_evaluation_constants;
+}
+
 }	// namespace technicalmachine

source/clients/client.hpp

 #ifndef CLIENTS__CLIENT_HPP_
 #define CLIENTS__CLIENT_HPP_
 
+#include "../evaluate/evaluate.hpp"
+
 #include "../team_predictor/detailed_stats.hpp"
 
 namespace technicalmachine {
 class Client {
 	public:
 		DetailedStats const & detailed() const;
+		Evaluate const & evaluation_constants() const;
 		virtual ~Client() { }
+	protected:
+		void reload_settings();
 	private:
 		DetailedStats detailed_stats;
+		Evaluate m_evaluation_constants;
 };
 
 }	// namespace technicalmachine

source/clients/network/client.cpp

 	connect ();
 }
 
-Evaluate const & Client::evaluation_constants() const {
-	return m_evaluation_constants;
-}
-
 void Client::print_with_time_stamp (std::ostream & stream, std::string const & message) const {
 	stream << time_stamp() + " " + message + "\n";
 }
 	highlights = load_highlights ();
 	trusted_users = load_trusted_users ();
 	load_settings (true);
-	m_evaluation_constants.load();
+	reload_settings();
 }
 
 bool Client::challenges_are_queued() const {

source/clients/network/client.hpp

 #include "../battles.hpp"
 #include "../client.hpp"
 
-#include "../../evaluate/evaluate.hpp"
-
 namespace technicalmachine {
 class Party;
 enum class Result;
 	public:
 		void print_with_time_stamp(std::ostream & stream, std::string const & message) const;
 		void handle_channel_message (uint32_t channel_id, std::string const & user, std::string const & message) const;
-		Evaluate const & evaluation_constants() const;
 		void send_message(OutMessage & msg);
 	protected:
 		explicit Client(unsigned set_depth);
 		std::random_device rd;
 		std::mt19937 random_engine;
 		std::unique_ptr<boost::asio::ip::tcp::socket> socket;
-		Evaluate m_evaluation_constants;
 		std::string current_username;
 		std::string current_password;
 		std::string team_file_name;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.