Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update EntityFactory types + compiling errors #42

Merged
merged 2 commits into from
May 28, 2023

Conversation

nelsonsbrian
Copy link
Contributor

Did some EntityFactory types on my repo, so transferred the work I did to here.

There is some wonky assumptions made between the property of id/entityReference/area between the Area + Item/Npc/Room that some of them use some of those properties, and some others.

I think this gets us 1 step closer to true types and less type bypassing.

@nelsonsbrian nelsonsbrian requested a review from seanohue May 28, 2023 06:46
@nelsonsbrian
Copy link
Contributor Author

Also updated some types that were failing on build

keywords: string[];
quests?: EntityReference[];
uuid?: string;
}

export class Npc extends Scriptable(Character) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scriptable is already in Character and this was causing some circular dependency issues I believe

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right about this -- I forget if I fixed this the same way locally but I definitely ran into it. Good call

"@types/winston": "^2.4.4",
"@types/ws": "^7.4.5",
"bcryptjs": "^2.4.0",
"commander": "^4.1.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had a compile error from commander in the node_modules. We only use the 'types' in core-ts, so just upgraded to the real package (as the types are just a stub) until the error went away.

@@ -376,11 +378,14 @@ export class BundleManager {
* @param {EntityFactory} factory
* @return {Array<string>}
*/
async loadEntities(
async loadEntities<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good use of generics here

@seanohue seanohue merged commit 34757ed into master May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants