isaacscript-common 2.0.12 → 2.0.13
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.
package/dist/functions/math.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { Direction } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to normalize an integer.
|
|
4
|
+
*
|
|
5
|
+
* - If `x` is less than `min`, then it will be clamped to `min`.
|
|
6
|
+
* - If `x` is greater than `max`, then it will be clamped to `max`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function clamp(x: int, min: int, max: int): int;
|
|
2
9
|
export declare function getAngleDifference(angle1: float, angle2: float): float;
|
|
3
10
|
/**
|
|
4
11
|
* Helper function to get an array of equidistant points on the circumference around a circle.
|
package/dist/functions/math.lua
CHANGED
|
@@ -3,6 +3,12 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
3
3
|
local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
|
|
4
4
|
local ____direction = require("functions.direction")
|
|
5
5
|
local directionToVector = ____direction.directionToVector
|
|
6
|
+
function ____exports.clamp(self, x, min, max)
|
|
7
|
+
return math.max(
|
|
8
|
+
min,
|
|
9
|
+
math.min(x, max)
|
|
10
|
+
)
|
|
11
|
+
end
|
|
6
12
|
function ____exports.getAngleDifference(self, angle1, angle2)
|
|
7
13
|
local subtractedAngle = angle1 - angle2
|
|
8
14
|
return (subtractedAngle + 180) % 360 - 180
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^2.0.
|
|
28
|
+
"isaac-typescript-definitions": "^2.0.15"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"isaacscript-lint": "^1.0.150",
|