Skip to content

refactor: base can be null#336

Open
rickardlofberg wants to merge 1 commit into
mainfrom
rilo--use-nullable-position
Open

refactor: base can be null#336
rickardlofberg wants to merge 1 commit into
mainfrom
rilo--use-nullable-position

Conversation

@rickardlofberg

Copy link
Copy Markdown

When a bot is removed from the board the base should also be set to null

When a bot is removed from the board the base should also be set to null
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();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nu har det inte med den här pren att göra men varför sparar vi en lista av positioner? 🤔

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

får kolla i koden sen, skit samma. ett sidetrack i pren, it looks good to me

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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

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