Skip to main content

nil_core/world/
report.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use crate::error::Result;
5use crate::player::PlayerId;
6use crate::report::ReportKind;
7use crate::world::World;
8
9impl World {
10  /// Forwards a report to a player.
11  pub fn forward_report(&self, recipient: PlayerId, report: ReportKind) -> Result<()> {
12    if self.has_player(&recipient) {
13      self.emit_report(recipient, report)?;
14    }
15
16    Ok(())
17  }
18}