public async Task <string> Attack([FromBody] AttackShipRequest value) { var shipsInRange = await this.ShipManager.ScanAsync(value.CommandCode); var defendingShip = await this.ShipManager.GetShipAsync(value.TransponderCode); if (!shipsInRange.Contains(defendingShip)) { return("Attack failed. Ship out of range."); } await this.ShipManager.AttackShipAsync(value.CommandCode, value.TransponderCode); return("Attack Complete"); }
public async Task <string> Attack([FromBody] AttackShipRequest value) { await this.ShipManager.AttackShipAsync(value.CommandCode, value.TransponderCode); return("Attack Complete"); }