Player12
An open source football management simulator
Loading...
Searching...
No Matches
transfer_listing.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2// Football Management Project
3// Copyright (c) 2025 - 2026 Flavio Milinanni. All Rights Reserved.
4//
5// This file is part of the Football Management Project.
6// See the LICENSE file in the project root.
7// -----------------------------------------------------------------------------
8
9#pragma once
10
11#include <cstdint>
12#include <optional>
13
14#include "global/types.h"
15#include "model/gamedate.h"
16
25{
26 PlayerID player_id; // The player being sold
27 TeamID seller_team_id; // The team selling the player
28 uint32_t asking_price; // The price the seller wants (in currency units)
29 GameDateValue listing_date; // When the player was first listed
30
31 // Bid state — set when another team makes a bid
32 std::optional<TeamID> highest_bidder_id; // Team that made the highest bid
33 // (std::nullopt if none)
34 uint32_t highest_bid = 0; // Amount of the highest bid (0 if none)
35
36 // Cached for performance
37 float attention_score = 0.0f; // Calculated when listed, dictates AI interest
38
47 TransferListing(PlayerID pid, TeamID seller, uint32_t price,
48 GameDateValue date, float attention = 0.0f);
49
51 TransferListing() = default;
52};
Represents a specific date in the game world.
Definition gamedate.h:20
Represents a player listed on the transfer market.
Definition transfer_listing.h:25
uint32_t highest_bid
Definition transfer_listing.h:34
float attention_score
Definition transfer_listing.h:37
std::optional< TeamID > highest_bidder_id
Definition transfer_listing.h:32
uint32_t asking_price
Definition transfer_listing.h:28
TeamID seller_team_id
Definition transfer_listing.h:27
PlayerID player_id
Definition transfer_listing.h:26
GameDateValue listing_date
Definition transfer_listing.h:29
TransferListing()=default
Default constructor for map/serialization use.
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21