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

Fix #197 c center immutable offset wrapper resolve all issues #211

Open
wants to merge 44 commits into
base: master
Choose a base branch
from

Conversation

isaiaslafon
Copy link

@isaiaslafon isaiaslafon commented Oct 8, 2024

Wollok Language modification to fix default center and transformations issues before game start of game.center().
Is a new especial center position that post calculates and add an offset until the game starts. After start every center object return normal positions in the required methods (up, down, round, etc..). Updated and simplified.

… every use, when game start then update the offset of each one in the collection and change to a center running strategy. Not modeled as a full state to not add a setter in game for center attribute.
@isaiaslafon isaiaslafon marked this pull request as draft October 8, 2024 20:47
rodriguez-guillermo and others added 2 commits October 8, 2024 17:59
* Fix #86

* Add DS Store as ignored file for macs
* no se sale de los limites el visual char

* Update src/wollok/game.wlk

---------

Co-authored-by: Fernando Dodino <fernando.dodino@gmail.com>
@isaiaslafon isaiaslafon changed the title #197 c center inmutable offset wrapper resolve all issues #197 c center immutable offset wrapper resolve all issues Oct 8, 2024
* Fix #139

* Fix shouldMatchSuperclassReturnValue

* Sorting messages & using standard definition
@isaiaslafon isaiaslafon changed the title #197 c center immutable offset wrapper resolve all issues Fix #197 c center immutable offset wrapper resolve all issues Oct 8, 2024
fdodino and others added 19 commits October 8, 2024 19:07
Co-authored-by: Fernando Dodino <fernando.dodino@gmail.com>
Co-authored-by: Fernando Dodino <fernando.dodino@gmail.com>
Me comí una "s"

Co-authored-by: Fernando Dodino <fernando.dodino@gmail.com>
me comí una "s"

Co-authored-by: Fernando Dodino <fernando.dodino@gmail.com>
espacios

Co-authored-by: Fernando Dodino <fernando.dodino@gmail.com>
Tests for cyclic const instance references
…es (#218)

* Fix issue 274 in wollok-ts

* Achieved throwing error for void parameters in all cases

* Removing checkValidClosure

* Removing === void

* Fix assignments to void

* add validation for void singleton

* Enhancing validation test

* Using void expressions instead of void wko & add validations
…Keyword

Fix shouldUseOverrideKeyword para properties
MVitelli and others added 3 commits December 12, 2024 21:13
* redefine identity adding tests + validations messages

* Review requests

---------

Co-authored-by: Fernando Dodino <fernando.dodino@gmail.com>
* fix-flatmap

* Add tests for flatMap  using sets

* Add documentation

* Enhance wollok doc

---------

Co-authored-by: Guillermocastro22 <castrojunior068@gmail.com>
Co-authored-by: Fernando Dodino <fernando.dodino@gmail.com>
* documentacion dias string

* Update src/wollok/lang.wlk

---------

Co-authored-by: matnahuel <matias.nahuel.carabajal.mc@gmail.com>
Co-authored-by: Fernando Dodino <fernando.dodino@gmail.com>
@fdodino
Copy link
Contributor

fdodino commented Dec 13, 2024

buenísimo @isaiaslafon , avisanos cuando esté para revisar

* Add validation test

* Add extra test
* Fix flatten

* Enhance wollok doc for flatten
@isaiaslafon
Copy link
Author

isaiaslafon commented Dec 13, 2024

As a first aproximation to the issue is not bad, but beacause is only affecting Wollok-TS and not Xtext version maybe is better to translate the code to TS domain, I even believe in TS maybe we can "hack" origin/center references and set a final value after start. But I don't know much about TypeScript yet.

fdodino and others added 2 commits December 19, 2024 22:15
* Add sanity & validation tests

* Add tests for uppercase validations

* Add string with unicode chars

* Update test/sanity/basics/unicode.wtest

Co-authored-by: Nahuel Palumbo <nahuel.palumbo@gmail.com>

* Add extra tests

---------

Co-authored-by: Nahuel Palumbo <nahuel.palumbo@gmail.com>
…wollok_ts_cli_issue_201

wrap actions using io.runHandler (fix #229 )
@PalumboN
Copy link
Contributor

PalumboN commented Jan 2, 2025

Hola @isaiaslafon ! Disculpá que colgué en revisar esto. Muy groso todo!

Yo acá implementaría las cosas como queremos: make it work - make it right - make it fast. No me preocuparía por la 3) hasta no tener la 2).
Además estoy trabajando en optimizaciones del lenguaje en esta branch de ts (midiendo la performance) que me parece lo más prolijo.

De este PR solo me quedaría con la clase CenteredPosition con una implementación naive fácil de entender. Y si querés se podría devolver posiciones normales a partir de esta una vez que comenzó el juego.

Por ejemplo:

class CenteredPosition inherits AbstractPosition {
  const offsetX
  const offsetY

  override method x() = game.width().div(2) + offsetX
  ....
  
  // Acá se podría fijar si el juego ya empezó y cambiar a trabajar con posiciones normales, esto debería ser transparente para el usuario y no tiene mucho costo.
  override method createPosition(_x, _y) = if (game.started()) new Position(...) else new CenterPosition(...)
}

Con esto ya se soluciona el issue de que los objetos no aparecen donde se espera. Y los temas de que Game es lento lo podemos ir atacando transversalmente.

@isaiaslafon
Copy link
Author

Me convence 100% lo que decis! En principio lo había resuelto así para generar en el game start un poco más de trabajo pero luego que ya quede simplificado. Pero me gusta mucho la propuesta que haces. Tengo que ver bien como bajo y genero los tests de todo y de esta solución, tuve problemas cuando quise hacer todo por ssh y no los pude solucionar en su momento. Tengo que retomar y configurar de 0. Gracias!

@isaiaslafon
Copy link
Author

Cualquier cosa si pueden echarle una mirada, ¿prefieren que se repita código de xCenter yCenter tanto en game como Center?

@PalumboN
Copy link
Contributor

PalumboN commented Feb 4, 2025

@isaiaslafon así está re piola! Habría que agregarle tests, fijate en los sanity: https://github.com/uqbar-project/wollok-language/tree/master/test/sanity/game

@isaiaslafon
Copy link
Author

Estoy haciendo los test, surgió una duda con eso, en la versión de TS permite configurar el tablero conl alto y ancho con números con decimales (ya agregué un issue en TS), pero no se si tener esto en cuenta para el "round" de CenterOffset ya que simplificaría saber que nunca el alto y ancho van a ser números que se necesiten redondear.

@isaiaslafon así está re piola! Habría que agregarle tests, fijate en los sanity: https://github.com/uqbar-project/wollok-language/tree/master/test/sanity/game

@isaiaslafon isaiaslafon marked this pull request as ready for review February 10, 2025 17:25
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.