magicrealmsshared 0.6.41 → 0.6.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ export type GameDay = number;
2
+ export declare function dateToGameDay(date: Date): number;
3
+ export declare function gameDayToData(gameDay: GameDay): Date;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dateToGameDay = dateToGameDay;
4
+ exports.gameDayToData = gameDayToData;
5
+ const GameDaysPerRLDay = 6;
6
+ const MiliSecondsPerDay = 86400000;
7
+ function dateToGameDay(date) {
8
+ return Math.floor(date.getTime() / MiliSecondsPerDay * GameDaysPerRLDay);
9
+ }
10
+ function gameDayToData(gameDay) {
11
+ return new Date(Math.floor(gameDay * MiliSecondsPerDay / GameDaysPerRLDay));
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magicrealmsshared",
3
- "version": "0.6.41",
3
+ "version": "0.6.42",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -32,6 +32,10 @@
32
32
  "types": "./dist/game/colors.d.ts",
33
33
  "default": "./dist/game/colors.js"
34
34
  },
35
+ "./game/time": {
36
+ "types": "./dist/game/time.d.ts",
37
+ "default": "./dist/game/time.js"
38
+ },
35
39
  "./geo/chunks": {
36
40
  "types": "./dist/geo/chunks.d.ts",
37
41
  "default": "./dist/geo/chunks.js"