-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
43 additions
and
165 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
export * from './generator'; | ||
export * from './generator/types'; | ||
export * from './world'; | ||
export * from './world/types'; | ||
export * from './world/biome'; | ||
export * from './world/biome/types'; | ||
export * from './utils/perlin'; | ||
export * from './utils/seed'; | ||
export { WorldGenerator } from "./generator"; | ||
export { World } from "./world"; | ||
export { WorldBiome } from "./biome"; | ||
import type { WorldConfig, WorldPoint } from "./world/types"; | ||
import type { WorldGenerationParams } from "./generator/types"; | ||
import type { WorldBiomeConfig } from "./biome/types"; | ||
export type { WorldConfig, WorldPoint, WorldGenerationParams, WorldBiomeConfig, }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
import type { PerlinParameters } from "./types"; | ||
export declare class Perlin { | ||
static generate({ x, y, seed, config }: PerlinParameters): number; | ||
private static clamp; | ||
private static scaledCosine; | ||
private static smootherStep; | ||
private static heightFalloff; | ||
private static normalizeConfig; | ||
} | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1 @@ | ||
import type { WorldConfig } from "../../world/types"; | ||
export type PerlinParameters = { | ||
seed: number[]; | ||
config: WorldConfig; | ||
x: number; | ||
y: number; | ||
}; | ||
export {}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
export declare class Seed { | ||
static generate(size?: number): number[]; | ||
} | ||
export {}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
export * from './generator'; | ||
export * from './generator/types'; | ||
export * from './world'; | ||
export * from './world/types'; | ||
export * from './world/biome'; | ||
export * from './world/biome/types'; | ||
export * from './utils/perlin'; | ||
export * from './utils/seed'; | ||
export { WorldGenerator } from "./generator"; | ||
export { World } from "./world"; | ||
export { WorldBiome } from "./biome"; | ||
|
||
import type { WorldConfig, WorldPoint } from "./world/types"; | ||
import type { WorldGenerationParams } from "./generator/types"; | ||
import type { WorldBiomeConfig } from "./biome/types"; | ||
|
||
export type { | ||
WorldConfig, | ||
WorldPoint, | ||
WorldGenerationParams, | ||
WorldBiomeConfig, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
/** | ||
* @internal | ||
*/ | ||
export class Seed { | ||
public static generate(size: number = 512) { | ||
const seed: number[] = []; | ||
|
||
for (let i = 0; i < size; i++) { | ||
seed.push(Math.random()); | ||
} | ||
|
||
return seed; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters