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

Merge WBSCInput and WBSCOutput types #239

Open
AloisSeckar opened this issue Jul 14, 2024 · 0 comments
Open

Merge WBSCInput and WBSCOutput types #239

AloisSeckar opened this issue Jul 14, 2024 · 0 comments
Labels
1.4 target Issues aimed for 1.4 release maintenance Code and project improvements

Comments

@AloisSeckar
Copy link
Owner

AloisSeckar commented Jul 14, 2024

Currently we have separate type WBSCInput to model user input and we are transforming it to WBSCOutput during evaluation process.

The types are largely the same. The most notable differences are WBSCOutput has text1 and text2 fields to represent text being printed out onto HTML Canvas and the extraOutput array to represent additional advances of the same player ("flat" array of 1-10 inputs is being mapped into 1-4 outputs with possible nested values).

Having the two types separately brings unnecessary (i.e. here) and even counter-intuitive (i.e. here) overhead. It should be possible to merge those structures into just one to avoid extra complexity.

The most challenging place to change should be renderAction method where the extra inputs for same player are handled recursively. The simpliest way to deal with this is to create the required structure on-the-fly in processAction before this loop.

@AloisSeckar AloisSeckar added the maintenance Code and project improvements label Jul 14, 2024
@AloisSeckar AloisSeckar added the 1.3 target Issues aimed for 1.3 release label Aug 31, 2024
@AloisSeckar AloisSeckar added 1.4 target Issues aimed for 1.4 release and removed 1.3 target Issues aimed for 1.3 release labels Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.4 target Issues aimed for 1.4 release maintenance Code and project improvements
Projects
None yet
Development

No branches or pull requests

1 participant