-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ослина Анастасия #249
base: master
Are you sure you want to change the base?
Ослина Анастасия #249
Conversation
private readonly List<Rectangle> rectangles = []; | ||
private readonly Point center = new(); | ||
|
||
public CircularCloudLayouter(ICloudDistribution distribution) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давай также сделаем возможность указывать позицию центра
var rnd = new Random(); | ||
for (var i = 0; i < rectanglesCount; i++) | ||
{ | ||
var rectangleSize = new Size(rnd.Next(5, 30), rnd.Next(5, 30)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не плохо бы добавить, чтобы можно было управлять размерами прямоугольников
|
||
|
||
[TestFixture] | ||
public class CircularCloudLayouterTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests)
} | ||
|
||
[Test] | ||
public void CircularCloudLayouter_Initialize() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Из названия не понятно, что должно быть после инициализации
public Size GetCloudSize() | ||
{ | ||
if (rectangles.Count == 0) | ||
throw new ArgumentException("Cloud cannot be empty."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мы выбрасываем ArgumentException хотя не передаем никаких аргументов. Может стоит немного поменять логику, например возвращать Size(0, 0)
} | ||
} | ||
|
||
public void SaveToPath(string fileName, string imagesPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно вынести в отдельный класс, что придерживаться Single Responsibility Principle. Рендерер как будто не про сохранение картинок
@ksamnole