public void Move() { Console.WriteLine("{0} is moving from {1}, {2}", _name, _xCoordinate, _yCoordinate); Console.Write("{0} is moving by ", _name); _moveBehavior.Move(); _xCoordinate += _xVelocity; _yCoordinate += _yVelocity; Console.WriteLine("{0} is now at {1}, {2}", _name, _xCoordinate, _yCoordinate); }
[HttpPost("{_}/move")] // Для универсальности ¯\_(ツ)_/¯ public virtual IActionResult Move([FromBody] MoveDto move) { try { var startTime = DateTime.Now; var result = _behavior.Move(MoveDto.MapFromDto(move)); var diffMilliseconds = (DateTime.Now - startTime).Milliseconds; if (diffMilliseconds > 200) { Console.WriteLine($"!!!!!!! Вычисление заняло {diffMilliseconds}"); } return(Ok(result)); } catch (Exception ex) { Console.WriteLine($"Ошибка при вызове Move => {ex.Message}"); return(Ok()); } }
public void Move() { moveBehavior.Move(); }
public virtual void DoMove() { MoveBehavior.Move(); }
public void StartMoving() { _moveStrategy.Move(this); Console.WriteLine(); Console.WriteLine($"Position: {Position}"); }