コード例 #1
0
        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);
        }
コード例 #2
0
 protected virtual void OnAfterTurn(TurnEventArgs e)
 {
     AfterTurn?.Invoke(this, e);
 }