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

Support ispx with generics #312

Merged
merged 3 commits into from
Aug 28, 2024
Merged

Support ispx with generics #312

merged 3 commits into from
Aug 28, 2024

Conversation

nighca
Copy link
Collaborator

@nighca nighca commented Aug 16, 2024

Update goplus/builder#765

We simplified function body of Gopt_Game_Gopx_GetWidget in this PR to make it easy for ispx to support generics. See detials in goplus/builder#765 (comment)

Related change in Builder: goplus/builder#767

@@ -112,7 +112,6 @@ type Spriter interface {
}
type Gamer interface {
initGame(sprites []Spriter) *Game
getGame() *Game
Copy link
Collaborator Author

@nighca nighca Aug 28, 2024

Choose a reason for hiding this comment

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

For now we need to maintain the same interface Gamer in ispx to make it work in browser, see details in https://github.com/goplus/builder/blob/35c6e0883c5c66b29eaeed2bf99d0731f06774f9/tools/ispx/main.go#L74-L76

It is better to keep Gamer as simple as possible.

We defined another interface ShapeGetter to implement getWidget. ShapeGetter is implemented by both *Game & *Sprite.

@nighca nighca marked this pull request as ready for review August 28, 2024 01:58
@nighca nighca changed the title [WIP] Support ispx Support ispx Aug 28, 2024
@nighca nighca changed the title Support ispx Support ispx with generics Aug 28, 2024
@JiepengTan JiepengTan self-requested a review August 28, 2024 02:14
@nighca nighca merged commit d1b083e into goplus:main Aug 28, 2024
3 checks passed
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