16 lines
364 B
JavaScript
16 lines
364 B
JavaScript
|
import {System} from '@/ecs/index.js';
|
||
|
|
||
|
export default class PassTime extends System {
|
||
|
|
||
|
tick(elapsed) {
|
||
|
const {Time} = this.ecs.get(1);
|
||
|
if (Time) {
|
||
|
Time.irlSeconds += elapsed;
|
||
|
while (Time.irlSeconds >= Time.constructor.gameDayLengthInRealSeconds) {
|
||
|
Time.irlSeconds -= Time.constructor.gameDayLengthInRealSeconds;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|