public void SetPosition(Position position, IArea area) { if (!area.IsValid(position)) { var size = area.GetSize(); var exceptionMessage = string.Format("Deploy failed for point ({0},{1}). Plateau size is {2} x {3}.", position.X, position.Y, size.Width, size.Height); throw new Exception(exceptionMessage); } _position.X = position.X; _position.Y = position.Y; _position.Direction = position.Direction; }