1. David Stone
  2. Technical Machine

Commits

David Stone  committed 2c26861

Moved EvaluationConstants into the generic client.

  • Participants
  • Parent commits fa230cf
  • Branches default

Comments (0)

Files changed (4)

File source/clients/client.cpp

View file
  • Ignore whitespace
 
 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

File source/clients/client.hpp

View file
  • Ignore whitespace
 #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

File source/clients/network/client.cpp

View file
  • Ignore whitespace
 	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 {

File source/clients/network/client.hpp

View file
  • Ignore whitespace
 #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;