Skip to content

Conversation

@Soamid
Copy link
Collaborator

@Soamid Soamid commented Dec 7, 2022

No description provided.

Copy link
Collaborator Author

@Soamid Soamid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ocena za lab: 1.8 / 2

private final IWorldMap map;
private final Vector2d[] animalsVectors;
private final List<Animal> animalsOnMap = new ArrayList<>();
protected AppVisualizer appVisualizer;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tej zależności zdecydowanie nie chcemy, właśnie po to nam observer żeby uniknąć sytuacji gdy engine musi znać GUI. Wystarczyłoby żeby konstruktor przyjmował go jako IPositionChangeObserver i nie zapisywał tego w atrybucie nawet, tylko rejestrował od razu w zwierzątkach.

this.appVisualizer = appVisualizer;
this.moveDelay = moveDelay;
}
public SimulationEngine(IWorldMap map, Vector2d[] animalsVectors, AppVisualizer appVisualizer, int moveDelay){
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

te konstruktory są ryzykowne - zawsze powinniśmy zwijać jeden w drugi od najmniejszego do największego. Obecnie np. będziemy próbowali dodać nullowy visualizer jeśli użyjemy pierwszego konstruktora.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants