Skip to content

Commit

Permalink
Add onUpdate method
Browse files Browse the repository at this point in the history
  • Loading branch information
BoomEaro committed May 11, 2023
1 parent d693a21 commit d6fdac3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ru.boomearo</groupId>
<artifactId>Board</artifactId>
<version>1.2</version>
<version>1.2.1</version>
<packaging>jar</packaging>

<name>Board</name>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ru/boomearo/board/objects/PlayerBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ public void handleBoard() {
if (getPageIndex() <= maxPage) {
AbstractPage thisPage = getCurrentPage();

thisPage.performUpdate();

int nextPageIndex = getNextPageNumber();
AbstractPage nextPage = getPageByIndex(nextPageIndex);

Expand Down
13 changes: 13 additions & 0 deletions src/main/java/ru/boomearo/board/objects/boards/AbstractPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,19 @@ protected ScoreSequenceFactory getScoreSequenceFactory() {
return DefaultScoreSequenceFactory.TO_ZERO;
}

public void performUpdate() {
try {
onUpdate();
}
catch (Exception e) {
e.printStackTrace();
}
}

protected void onUpdate() {

}

protected abstract long getTimeToChange();

protected abstract boolean isVisible();
Expand Down

0 comments on commit d6fdac3

Please sign in to comment.