silphius/app/ecs/systems/pass-time.js

16 lines
364 B
JavaScript
Raw Normal View History

2024-07-04 15:17:33 -05:00
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;
}
}
}
}