if let Some(player) = self
.players
.get_mut(&unit_initialized_event.control_player_id)
{
if is_valid_structure_or_unit(&unit_initialized_event.unit_type_name) {
let placement: Option<Placements> =
identify_placement(&unit_initialized_event.unit_type_name);
match placement.unwrap() {
Placements::Structures => {
player.register_structure()
}
#A public method is not visible??
10 messages · Page 1 of 1 (latest)
for some reason
player.register_structure is not a valid function...
it doesnt make sense
error: no method named register_structure found for mutable reference &mut Player in the current scope
label: this is an associated function, not a method
label: this is an associated function, not a method
This is the important bit of the error message. register_structure does not have a self parameter, so it is not a method, so you cannot call it using method syntax thing.method()
ohh
Assoc function can't be called using dot ) Player::my_assoc_fun(player)