Criando superclasse abstrata Pirata e Separando responsabilidades em spawn de itens#2
Open
leticiacb1 wants to merge 2 commits intomainfrom
Hidden character warning
The head ref may contain hidden characters: "Refatora\u00e7\u00e3o-APS4"
Open
Criando superclasse abstrata Pirata e Separando responsabilidades em spawn de itens#2leticiacb1 wants to merge 2 commits intomainfrom
leticiacb1 wants to merge 2 commits intomainfrom
Conversation
Collaborator
Author
Coesão escolhida: Extrair funções ou métodos para separar responsabilidades.Extraiu-se as funções A função Dessa forma , houve uma maior divisão das funcionalidades, melhorando a especificidade dessa parte do código. |
Collaborator
Author
|
Integrantes:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Abstração escolhida: Criar uma superclasse para representar características em comum.
A superclasse abstrata
Piratafoi criada para representar, de forma geral, as características das classespiratas_esquerda,pirata_direita,pirata_baixo e pirata_cima. Essas classes possuiam atributos comuns assim como funções semelhantes comoupdate(atualização dos estados e posições no mapa desses sprites),draw_health(desenha a barra de vida de acordo com os danos sofridos por cada sprite).Foram agrupadas caracteristicas em comum e repetidas em cada uma dessas classes nessa superclasse (
Pirata) e utilizou-se herança e polimorfismo para passar essas características comuns a todas. A funçãodraw_health, por exemplo, foi completamente aproveitada por todas as classes filhas.