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

pattern application #1

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

pattern application #1

wants to merge 29 commits into from

Conversation

eunsdaily
Copy link

We applied the software pattern to your project and code refactoring as a school assignment.

musicianZem and others added 29 commits June 5, 2017 17:20
2. GameManager.java, State.java, StateZero, StateOne, StateTwo,
StateThree, StateFour
3. Because the updateStatus () and perform Status () of the GameManager
divide the state by the conditional statement, the state pattern is
applied
State Pattern applyed
2. Refactoring applies to Boss, EnemyEntity, EnemyUnit.
3. Boss and EnemyUnit have same code.
GameManager.java, State.java, StateAllEnemiesDead.java,
StateAllPlayersDead.java, StateMovingPlayerintoPosition.java,
StateOngoingGame.java, StateStart.java
Because the updateStatus () and perform Status () of the GameManager
divide the state by the conditional statement, the state pattern is
applied
2. The refactoring target is Boss class.
3. The condition is long(bad smell)
2. The refactoring target is Boss class.
3. The previous function updateBullets has two functions, which violates
the SRP.
2. GameManager.java, State.java, StateAllEnemiesDead.java,
StateAllPlayersDead.java, StateMovingPlayerintoPosition.java,
StateOngoingGame.java, StateStart.java, StateMethods.java
3. Because the updateStatus () and perform Status () of the GameManager
divide the state by the conditional statement, the state pattern is
applied
2. Refactoring was conducted for Boss, EnemyEntity, EnemyUnit.
3. in draw, Boss and EnemyUnit has same code.
2. SingleplayerBoard.java, GameManager.java
3. There should be only one gameManager in a game. You can add the game
you were doing, and the return function. The determination of the game
was improved.
2. mainGUI -> enemyPenel, enemyUpdateList, skinPanel, skinUpdatePanel, GUIPanel, UpdateList
3. this pattern guarantee 'updateList' function's encapsulation and Flexibility. thus extendability increase.
2. mainGUI/FontData
3. In enermyPanel, skinPanel, and onlinePanel, we use the Font variable,
which creates a new instance each time. we also use the Font variable
for other classes. Because it is not a good idea to call instances
often, I applied the Singleton pattern.
2. main/SingleplayerBoard
3. It does several things in one method. So I extract method.
2. mainGUI/playerData
3. It does two things in one method. So I extract method.
2. mainGUI/MainMenu
3. It does several things in one method. So I extract method.
2. mainGUI/onlinePanel
3. It does several things in one method. So I extract method.
2. The refactoring target is EnemyUnit class.
3. The condition is long
refactoring(Abstract class)
2. The refactoring targets are StateMehods, StateAllPlayersDead,
StateAllEnemiesDead, StateOngoingGame.
3. duplicated method.
2. enemyPanel, GUIPanel, skinPanel
3. add setUpdateListStrategy to GUIPanel for encapsulation.
1. no pattern just refactoring(extra method and pull up)
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.

None yet

3 participants