forked from jmcneese/libnoise.js
-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
05513e7
commit 6c64f80
Showing
10 changed files
with
69 additions
and
98 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import Module from "@app/module"; | ||
import NoiseMap from "@app/noisemap"; | ||
|
||
export default abstract class Builder { | ||
public sourceModule: Module; | ||
public noiseMap: NoiseMap; | ||
|
||
public constructor(sourceModule: Module, width: number, height: number) { | ||
this.sourceModule = sourceModule; | ||
this.noiseMap = new NoiseMap(width, height); | ||
} | ||
|
||
// Functions | ||
public abstract build(): NoiseMap; | ||
|
||
public setSize(width: number, height: number): void { | ||
this.width = width; | ||
this.height = height; | ||
} | ||
|
||
// Properties | ||
public get width(): number { | ||
return this.noiseMap.width; | ||
} | ||
public set width(width: number) { | ||
this.noiseMap.width = width; | ||
} | ||
|
||
public get height(): number { | ||
return this.noiseMap.height; | ||
} | ||
public set height(height: number) { | ||
this.noiseMap.height = height; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default abstract class Module { | ||
// Functions | ||
public abstract getValue(x: number, y: number, z: number): number; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Module from './Module'; | ||
|
||
export { | ||
Module as default, | ||
}; |
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