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

engine: Convert to typescript #33

Merged
merged 1 commit into from
Jun 1, 2024

Conversation

criticic
Copy link
Contributor

@criticic criticic commented Jun 1, 2024

This commit converts the engine to typescript, and adds relevant types for all relevant functions and variables.

The player type is set to have a id field, and cards field containing
an array of UNOCards

Fixes #25

Checklist

  • I have tested these changes locally.
  • I have reviewed the code and ensured it follows the project's coding guidelines.
  • I have updated the documentation, if necessary.
  • I have assigned reviewers to this pull request.

The test fails due to eslint disallowing any type

Copy link
Collaborator

@kuv2707 kuv2707 left a comment

Choose a reason for hiding this comment

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

Suggested minor changes.

backend/uno-game-engine/types.d.ts Outdated Show resolved Hide resolved
This commit converts the engine to typescript, and adds relevant types
for all relevant functions and variables.

The player type is set to have a id field, and cards field containing
an array of UNOCards

Fixes shivansh-bhatnagar18#25

Signed-off-by: Sagnik Mandal <[email protected]>
@criticic
Copy link
Contributor Author

criticic commented Jun 1, 2024

The other ESLint errors, are unrelated to this PR, I have fixed the prettier issue though.

@criticic criticic requested a review from kuv2707 June 1, 2024 04:42
@kuv2707 kuv2707 merged commit 6541b5c into shivansh-bhatnagar18:master Jun 1, 2024
5 of 6 checks passed
@kuv2707
Copy link
Collaborator

kuv2707 commented Jun 1, 2024

Merged, thanks @criticic

@kuv2707
Copy link
Collaborator

kuv2707 commented Jun 1, 2024

Yes, I realized it later.
We'll have to define a different type for the User objects.

@criticic criticic mentioned this pull request Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert module to TypeScript: engine.js
2 participants