refactor: base can be null#336
Open
rickardlofberg wants to merge 1 commit into
Open
Conversation
When a bot is removed from the board the base should also be set to null
indrif
approved these changes
Oct 4, 2023
Comment on lines
+27
to
+39
| get position(): Position | null { | ||
| if (this.positions.length > 0) { | ||
| return { ...this.positions[this.positions.length - 1] }; | ||
| } | ||
| return null; | ||
| } | ||
| set position(newPosition: Position) { | ||
| this.positions.push(newPosition); | ||
| set position(newPosition: Position | null) { | ||
| if (newPosition) { | ||
| this.positions.push(newPosition); | ||
| } else { | ||
| // Is this reasonable? Every getter needs a setter. | ||
| this.clearPositions(); | ||
| } |
Contributor
There was a problem hiding this comment.
nu har det inte med den här pren att göra men varför sparar vi en lista av positioner? 🤔
Author
There was a problem hiding this comment.
Det kan jag tyvärr inte svara på. Misstänker för att vi vill ha bottens historia?
Jag konstaterade bara att när vi hämtar nuvarande position så tar vi det sista i listan så jag tänkte att vi konsekvent borde arbeta mot listan.
Contributor
There was a problem hiding this comment.
får kolla i koden sen, skit samma. ett sidetrack i pren, it looks good to me
Author
There was a problem hiding this comment.
Jag tänkte kolla igenom PRn en extra gång sen för har lite tankar om beteendet men just nu är jag lite i första halvan av "make it work, make it right"-läge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a bot is removed from the board the base should also be set to null