Skip to content

Commit 5ac4d55

Browse files
committed
Chg: #86 - change time and timeUnit storing method (from Integer to int) in ClockManager
1 parent aa4f21e commit 5ac4d55

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ This file lists modifications introduced by each version.
1818
the `MessageEngine` and all `Node.onClock()`).
1919
Everything is now properly synchronized.
2020

21+
**Symbol modification in ClockManager**
22+
23+
* `ClockManager.currentTime()` now returns an `int` instead of an `Integer`
24+
25+
This value could never be `null`. The return value being an object was a remnant of previous versions.
26+
2127
[issue: #86]: https://github.com/jbotsim/JBotSim/issues/86
2228

2329
### New icon in the jbotsim-icons module

lib/jbotsim-core/src/main/java/io/jbotsim/core/ClockManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public class ClockManager {
3838
HashMap<ClockListener, Integer> countdown = new HashMap<>();
3939
Class<? extends Clock> clockModel = null;
4040
Clock clock = null;
41-
Integer time = CLOCK_INITIAL_VALUE;
42-
Integer timeUnit = 10; // duration of a round in ms
41+
int time = CLOCK_INITIAL_VALUE;
42+
int timeUnit = 10; // duration of a round in ms
4343
int nbPauses = 0;
4444
private boolean firstRound = true;
4545

@@ -157,7 +157,7 @@ public void setTimeUnit(int timeUnit){
157157
* Returns the current round number.
158158
* @return the current time.
159159
*/
160-
public Integer currentTime() {
160+
public int currentTime() {
161161
return time;
162162
}
163163

0 commit comments

Comments
 (0)