Skip to content
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

Applying Composite Design Pattern #20

Open
ManzanillaSebastian opened this issue Dec 17, 2024 · 1 comment
Open

Applying Composite Design Pattern #20

ManzanillaSebastian opened this issue Dec 17, 2024 · 1 comment

Comments

@ManzanillaSebastian
Copy link

Within the tetris package, applying the Composite pattern to this program makes the work of the Main client class easier. Previously, the client class implemented the display of the figures on the screen, and the Figure class was also responsible for implementing the movement of each of its cells. By applying Composite, the client class only calls the show() method of the Fi_g_ure class. Finally, the Figure class does not worry about implementing the display of the squares on the screen or their movement, instead, it only calls the show() and move() methods of each square respectively.

image
image
image
image
image

@peterarsentev
Copy link
Owner

@ManzanillaSebastian Thanks. Could you make a PR for this issue?

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

No branches or pull requests

2 participants