private void RaiseAfterTurn(Shot shoot, string raiseOnSide) { var args = new TurnEventArgs(); var positionToUpdate = new Position(shoot.X, shoot.Y); var shotResult = shoot.Result; if (shotResult == ShotResult.Hit || shotResult == ShotResult.HitDestroyed) { positionToUpdate.State = PositionState.Hit; } else { positionToUpdate.State = PositionState.Missed; } args.UpdateAtPlayer = raiseOnSide; args.PositionToUpdate = positionToUpdate; OnAfterTurn(args); }
protected virtual void OnAfterTurn(TurnEventArgs e) { AfterTurn?.Invoke(this, e); }