/
RaskolnickOFF
/
3D
Обзор
Документация
Войти
/
RaskolnickOFF
/
3D
Код
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
js/source/environment/EnvironmentState.js
51 строка
1 KB
RaskolnickOFF
weather: calendar-based seasons, weatherTypes interpolation, cloud control moved to WeatherSystem
16 июн 2026, 00:41
16 июн 2026, 00:41
40bd8db
Код
Авторство
О чём код?
// js/source/environment/EnvironmentState.js // Что это // Единый runtime-state всей environmental системы. // Это КРИТИЧНО. // Потом сюда: // clouds, // weather, // fog, // stars, // moon, // wind. // Почему НЕ singleton // Потому что: // ECS/context architecture, // testability, // save/load, // future multiplayer. export class EnvironmentState { constructor() { // Time of day in hours (0-24) this.timeOfDay = 8.0; this.normalizedTime = 8.0 / 24.0; this.day = 1; this.week = 1; this.calendarTime = 0; this.isNight = false; this.timeScale = 1.0; this.paused = false; // Sun properties this.sunHeight = 0.0; this.sunDirection = null; // Weather properties this.season = 'spring'; this.weather = 'clear'; // 'clear' | 'rain' | 'snow' this.weatherIntensity = 0; // 0-1 this.weatherTransition = 0; // 0-1 (плавный переход) this.weatherForced = false; // принудительная погода (debug) this.weatherForcedType = null; // 'rain' | 'snow' | null } }