-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Type fixes for sapphire + chore: Started working on sapphire-ecr…
… types
- Loading branch information
1 parent
16a5ec6
commit 14481ee
Showing
7 changed files
with
76 additions
and
10 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,42 @@ | ||
import type { Handle, Entity } from "@rbxts/ecr"; | ||
import type { singleton } from "@rbxts/sapphire"; | ||
|
||
declare type loop_type = "Stepped" | "Heartbeat" | "RenderStepped"; | ||
declare interface system { | ||
/** Fires every `RunService.Stepped` */ | ||
runner(delta_time: number): void; | ||
/** 1 = lowest priority */ | ||
priority?: number; | ||
/** Defaults to "Stepped" */ | ||
loop_type?: loop_type; | ||
} | ||
|
||
declare interface spawner<T> { | ||
/** | ||
* Creates an entity with the given components. | ||
* @param components T[] | ||
* @return ecr.entity | ||
*/ | ||
spawn(...components: T[]): ecr.entity; | ||
/** | ||
* Creates an entity with the given components and returns a handle to it. | ||
* @param components T[] | ||
* @return @ecr.Handle | ||
*/ | ||
spawn_with_handle(...components: T[]): ecr.Handle; | ||
} | ||
|
||
declare interface World { | ||
readonly identifier: "sapphire-ecr"; | ||
readonly methods: Map<string, (singleton: singleton) => void>; | ||
|
||
registry: ecr.registry; | ||
readonly stepped_systems: system[]; | ||
readonly heartbeat_systems: system[]; | ||
readonly render_stepped_systems: system[]; | ||
|
||
extension(): void; | ||
create_spawner<T>(...components: T[]): spawner<T>; | ||
spawn_entity(): ecr.entity; | ||
spawn_entity_with_handle(): ecr.Handle; | ||
} |
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,24 @@ | ||
{ | ||
"name": "@rbxts/sapphire-ecr", | ||
"version": "0.1.1-ts.1", | ||
"description": "A lightweight ECR scheduler for sapphire", | ||
"main": "lib/init.luau", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Mark-Marks/sapphire.git" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"author": "Mark-Marks", | ||
"license": "MIT", | ||
"homepage": "https://github.com/Mark-Marks/sapphire#readme", | ||
"dependencies": { | ||
"@rbxts/ecr": "^0.8.0-ts.2", | ||
"@rbxts/sapphire": "^0.1.1-ts.1" | ||
} | ||
} |
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,2 @@ | ||
--!strict | ||
local squash = require(script.Parent.squash) |
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
Empty file.