Creates a garbage zone for the virtual pad #34 #66

Merged
Romain merged 1 commits from Romain/JacoBot:Create_a_generator_of_token_for_the_virtual_pad_#31 into main 2024-04-28 11:47:52 +00:00
Member
close MDL29/JacoBot#34
Romain added the
JacoPad
JacoVirt
Fix
labels 2024-04-25 14:44:56 +00:00
Romain added 1 commit 2024-04-25 14:44:57 +00:00
Romain force-pushed Create_a_generator_of_token_for_the_virtual_pad_#31 from 2290ad3d23 to 041307a28c 2024-04-25 14:50:41 +00:00 Compare
Romain added 1 commit 2024-04-25 15:08:46 +00:00
Romain added 1 commit 2024-04-25 15:13:47 +00:00
Romain added 1 commit 2024-04-25 15:17:58 +00:00
HS-157 requested changes 2024-04-26 19:51:16 +00:00
Dismissed
HS-157 left a comment
Owner

Ça plante quand on clique sur la poubelle quand on n'a pas de token dans la main.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/romain/jacovirt/jacovirt/args.py", line 50, in main
    window.main()
  File "/tmp/romain/jacovirt/jacovirt/pad/window.py", line 143, in main
    arcade.run()
  File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/arcade/window_commands.py", line 289, in run
    pyglet.app.run()
  File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/app/__init__.py", line 107, in run
    event_loop.run(interval)
  File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/app/base.py", line 185, in run
    platform_event_loop.step(timeout)
  File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/app/xlib.py", line 120, in step
    device.select()
  File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/canvas/xlib.py", line 202, in select
    dispatch(e)
  File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/window/xlib/__init__.py", line 973, in dispatch_platform_event_view
    event_handler(e)
  File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/window/xlib/__init__.py", line 1469, in _event_button
    self.dispatch_event('on_mouse_release', x, y, button, modifiers)
  File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/window/__init__.py", line 1361, in dispatch_event
    super().dispatch_event(*args)
  File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/event.py", line 427, in dispatch_event
    raise e
  File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/event.py", line 422, in dispatch_event
    if getattr(self, event_type)(*args):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/romain/jacovirt/jacovirt/pad/window.py", line 124, in on_mouse_release
    self.held_token.remove_from_sprite_lists()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'remove_from_sprite_lists'

Je pense aussi que c'est le Token_trash qui doit porter l'action de supprimer le jeton.

Ça plante quand on clique sur la poubelle quand on n'a pas de token dans la main. ``` Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/romain/jacovirt/jacovirt/args.py", line 50, in main window.main() File "/tmp/romain/jacovirt/jacovirt/pad/window.py", line 143, in main arcade.run() File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/arcade/window_commands.py", line 289, in run pyglet.app.run() File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/app/__init__.py", line 107, in run event_loop.run(interval) File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/app/base.py", line 185, in run platform_event_loop.step(timeout) File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/app/xlib.py", line 120, in step device.select() File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/canvas/xlib.py", line 202, in select dispatch(e) File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/window/xlib/__init__.py", line 973, in dispatch_platform_event_view event_handler(e) File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/window/xlib/__init__.py", line 1469, in _event_button self.dispatch_event('on_mouse_release', x, y, button, modifiers) File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/window/__init__.py", line 1361, in dispatch_event super().dispatch_event(*args) File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/event.py", line 427, in dispatch_event raise e File "/home/hs-157/.cache/pypoetry/virtualenvs/jacovirt-6wsk1rFe-py3.11/lib/python3.11/site-packages/pyglet/event.py", line 422, in dispatch_event if getattr(self, event_type)(*args): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/romain/jacovirt/jacovirt/pad/window.py", line 124, in on_mouse_release self.held_token.remove_from_sprite_lists() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'remove_from_sprite_lists' ``` Je pense aussi que c'est le `Token_trash` qui doit porter l'action de supprimer le jeton.
HS-157 self-assigned this 2024-04-26 19:57:03 +00:00
Romain added 3 commits 2024-04-26 20:23:37 +00:00
Romain force-pushed Create_a_generator_of_token_for_the_virtual_pad_#31 from 248b237113 to 8aba34d938 2024-04-26 20:24:46 +00:00 Compare
Romain force-pushed Create_a_generator_of_token_for_the_virtual_pad_#31 from 8aba34d938 to d688c219ad 2024-04-26 20:26:01 +00:00 Compare
Romain changed title from Creates a garbage zone for the virtual pad #34 to WIP: Creates a garbage zone for the virtual pad #34 2024-04-26 20:26:41 +00:00
Romain changed title from WIP: Creates a garbage zone for the virtual pad #34 to Creates a garbage zone for the virtual pad #34 2024-04-26 20:26:59 +00:00
Romain scheduled this pull request to auto merge when all checks succeed 2024-04-26 20:43:23 +00:00
HS-157 requested changes 2024-04-26 20:45:56 +00:00
Dismissed
@ -126,3 +118,1 @@
if len(tokens_trash) > 0:
# Delete the held token
self.held_token = None
if self.held_token is not None:
Owner

Attention en faisant comme ça, ta ligne 118 devient doublon avec la ligne 127, il faut regarder un peu plus loin que son code quand on rajoute des modifications. 🙂

Attention en faisant comme ça, ta ligne 118 devient doublon avec la ligne 127, il faut regarder un peu plus loin que son code quand on rajoute des modifications. 🙂
Romain marked this conversation as resolved
Romain force-pushed Create_a_generator_of_token_for_the_virtual_pad_#31 from d688c219ad to 15b5cef7a8 2024-04-26 20:58:51 +00:00 Compare
Romain canceled auto merging this pull request when all checks succeed 2024-04-26 21:03:08 +00:00
Author
Member

Dans la dernière modification j'ai changé l'ancienne ligne 127 par le else.

            # See if we are in contact with the closest trash, it yes delete the held token
            if arcade.check_for_collision(self.held_token, trash):
                    trash.remove_token(self.held_token)
            else:
                # Remove the token from the hand
                self.held_token = None

La prochaine fois je ferais le rebase a la fin 😅

Dans la dernière modification j'ai changé l'ancienne ligne 127 par le else. ~~~ # See if we are in contact with the closest trash, it yes delete the held token if arcade.check_for_collision(self.held_token, trash): trash.remove_token(self.held_token) else: # Remove the token from the hand self.held_token = None ~~~ La prochaine fois je ferais le rebase a la fin 😅
Romain added 1 commit 2024-04-26 21:15:47 +00:00
HS-157 requested changes 2024-04-26 21:22:57 +00:00
Dismissed
@ -134,0 +124,4 @@
trash.remove_token(self.held_token)
else:
# Remove the token from the hand
self.held_token = None
Owner

Cette ligne devrait être en dehors de la condition car, dans ce cas là, on a toujours le token dans la main tant qu'on n'a pas cliqué autre part que sur la poubelle ou qu'on a un autre token dans la main.

Cette ligne devrait être en dehors de la condition car, dans ce cas là, on a toujours le token dans la main tant qu'on n'a pas cliqué autre part que sur la poubelle ou qu'on a un autre token dans la main.
Romain marked this conversation as resolved
Romain added 1 commit 2024-04-27 09:35:31 +00:00
Romain force-pushed Create_a_generator_of_token_for_the_virtual_pad_#31 from 5cda5774b0 to 33a99d9f43 2024-04-27 21:33:55 +00:00 Compare
Romain force-pushed Create_a_generator_of_token_for_the_virtual_pad_#31 from 33a99d9f43 to 0d530b9ad6 2024-04-27 21:58:24 +00:00 Compare
Author
Member

J'ai juste changé le nom du commit 🙂

J'ai juste changé le nom du commit 🙂
HS-157 approved these changes 2024-04-27 22:12:53 +00:00
Romain merged commit 0d530b9ad6 into main 2024-04-28 11:47:52 +00:00
Romain deleted branch Create_a_generator_of_token_for_the_virtual_pad_#31 2024-04-28 11:47:52 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: MDL29/JacoBot#66
No description provided.