nil-core 0.6.6

Multiplayer strategy game
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (C) Call of Nil contributors
// SPDX-License-Identifier: AGPL-3.0-only

use crate::error::Result;
use crate::player::PlayerId;
use crate::report::ReportKind;
use crate::world::World;

impl World {
  /// Forwards a report to a player.
  pub fn forward_report(&self, recipient: PlayerId, report: ReportKind) -> Result<()> {
    if self.has_player(&recipient) {
      self.emit_report(recipient, report)?;
    }

    Ok(())
  }
}