Пример #1
0
 public void ExecuteMovement(Movement movement)
 {
     try
     {
         var piece = _pieceFactory.Create(movement);
         _ruleEngine.ApplyRules(_board, piece, movement);
         piece.Move(_board, movement);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public void ProcessOrder(Order order)
        {
            if (order == null)
            {
                throw new ArgumentNullException(nameof(order));
            }

            try
            {
                var rules = _ruleMatchService.GetMatchingRules(order);
                _ruleEngine.ApplyRules(rules, order);
            }
            catch (Exception e)
            {
                _logger.Log($"{order.Id} failed with error: {e.Message}", MessageType.Error);
            }
        }