silphius/app/ecs-systems/pass-time.js
2024-07-04 15:17:33 -05:00

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;
}
}
}
}