macro_rules! player_feature_adder {
    ($struct_name:ident, $prop_getter:expr, $( $column_names:expr ),* $(,)?) => { ... };
}
Expand description

This macro is used to implement necessary traits for an existing struct to add the calculated player-specific features to the data matrix. This macro is particularly useful when the feature adder needs to be instantiated with specific parameters. The number of column names and the length of the feature array returned by $prop_getter are checked at compile time to ensure they match.

Parameters

  • $struct_name: The name of the existing struct.
  • $prop_getter: The function or closure used to calculate the features.
  • $( $column_names:expr ),*: A comma-separated list of column names as strings.