Search profile: session API and console commands (ShowSearchProfile, SuggestSearchProfile, SetSearchProfile)
CareerSession gets search_profile, suggest_search_profile and dispatch_search_profile (owner and modal-state checks, revision only when the stored profile changed). The console replaces the OpenSearch placeholder with three commands and documents them; with apply the matching listings are reported with the original's "Spieler ... ist interessant!" message. search_profile_valid separates a refused profile from a switched-off one. Part of #79 (the dialog in the graphical client is still open) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ff4ad035a7
commit
b2484350d9
8 files changed
+145
-7
No files matched your search
@@ -38,6 +38,7 @@
|
||||
#include "game/pending_offer.hpp"
|
||||
#include "game/poach.hpp"
|
||||
#include "game/human_buyer_sale.hpp"
|
||||
#include "game/search_profile.hpp"
|
||||
#include "game/weekly.hpp"
|
||||
#include "ui/flow.hpp"
|
||||
#include "ui/desk_state.hpp"
|
||||
@@ -178,6 +179,21 @@ public:
|
||||
uint64_t& revision, std::string& error,
|
||||
const std::function<int(const GameState&, const TransferOfferListView&)>& review = {});
|
||||
|
||||
// The search profile of a human manager (transfer market buttons "Suchen" and "Vorschlag", game/search_profile.hpp).
|
||||
// `search_profile` is the stored profile, `suggest_search_profile` the one the squad asks for (nothing is stored).
|
||||
// `dispatch_search_profile` stores an edited profile the way the closing dialog does (`cancelled` = left by right
|
||||
// click, which switches the profile off) and, with `apply`, lists the transfer-list entries that fit it right now.
|
||||
// The revision rises only when the stored profile changed.
|
||||
SearchProfile search_profile(int manager) const;
|
||||
SearchProfile suggest_search_profile(int manager, bool whole_squad) const;
|
||||
struct SearchProfileDispatch {
|
||||
SearchProfile profile{};
|
||||
bool active = false;
|
||||
std::vector<SearchProfileHit> hits;
|
||||
};
|
||||
std::optional<SearchProfileDispatch> dispatch_search_profile(int manager, const SearchProfile& profile, bool cancelled,
|
||||
bool apply, uint64_t& revision, std::string& error);
|
||||
|
||||
struct TransferMarketPreviewDispatch {
|
||||
ui::PreparationState preparation;
|
||||
ui::TransferMarketPreview quote;
|
||||
|
||||
Reference in new issue
Block a user