Comparing version 0.0.14 to 0.0.15
module.exports = { | ||
JSCoord: require("./JSCoord"), | ||
JSCoord: require("./src/JSCoord"), | ||
CoordChunk: require("./src/CoordChunk") | ||
} |
{ | ||
"name": "jscoord", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "A simple Map coordinate system for NodeJS and potentially the browser.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -35,7 +35,7 @@ # JSCoord | ||
## Properties | ||
### Properties | ||
#### `.x`, `.y`, `.z` | ||
Get X, Y or Z value. **Do NOT modify these variables, they can break your coordinate set.** | ||
Get X, Y or Z value. **Do NOT modify these variables, they can break your coordinate set.** | ||
@@ -46,3 +46,3 @@ ```js | ||
## Methods | ||
### Methods | ||
@@ -153,2 +153,68 @@ JSCoord provides some basic mutation methods. They can be used to modify the coordinate set in different ways. | ||
coords.getRltArray() // [x, y, z] | ||
``` | ||
``` | ||
## CoordChunk | ||
CoordChunk is another feature of JSCoord. Its basically an Array of Sets with some extra functions. When creating a CoordChunk instance, you can pass a parameter to set the maximum size of the set. | ||
```js | ||
const { CoordChunk } = require("jscoord") | ||
``` | ||
Or if you use Typescript/Webpack: | ||
```ts | ||
import { CoordChunk } from "jscoord"; | ||
``` | ||
Then, to create a new instance: | ||
```js | ||
let chunk = new CoordChunk(10) | ||
``` | ||
### Properties | ||
`.limit` | ||
Maximum length of chunk. **Do NOT modify this variable, it can break your coordinate set.** | ||
```js | ||
chunk.limit | ||
``` | ||
`.sets` | ||
Array in which Sets are stored. **Do NOT modify this variable, it can break your coordinate set.** | ||
```js | ||
chunk.sets | ||
``` | ||
### Methods | ||
`.addSet(coords)` | ||
Add a Set to the Chunk. `coords` can be an Array with coordinate values `([x, y, z])` or a JSCoord instance. You can not have 2 of the same coordinate sets in the same chunk. | ||
```js | ||
chunk.addSet(new JSCoord(100, 100, 100)) | ||
``` | ||
`.getSet(coords)` | ||
Find a Set by coordinates. Throws if Set could not be found. | ||
```js | ||
chunk.getSet([100, 100, 100]) | ||
``` | ||
`.delSet(coords)` | ||
Delete a Set from the Chunk. `coords` can be an Array with coordinate values or a JSCoord instance. Throws if Set could not be found. | ||
```js | ||
chunk.delSet([100, 100, 100]) | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17367
7
405
218
1