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

created delivery drone class #547

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

Conversation

vsafian
Copy link

@vsafian vsafian commented Jul 11, 2023

No description provided.

Comment on lines 20 to 22
value = eval(f"self.{coord_name} {simbl} {step}")
setattr(self, coord_name, value)
self.coords[coord_index] = value

Choose a reason for hiding this comment

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

Suggested change
value = eval(f"self.{coord_name} {simbl} {step}")
setattr(self, coord_name, value)
self.coords[coord_index] = value
value = eval(f"self.coords[{coord_index}] {simbl} {step}")
self.coords[coord_index] = value

And totally remove x_pos, y_pos, z_pos just use indexes

Comment on lines 14 to 16
self.x_pos = list_isinstance(coords, X_INDEX)
self.y_pos = list_isinstance(coords, Y_INDEX)
self.coords = [self.x_pos, self.y_pos]

Choose a reason for hiding this comment

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

Suggested change
self.x_pos = list_isinstance(coords, X_INDEX)
self.y_pos = list_isinstance(coords, Y_INDEX)
self.coords = [self.x_pos, self.y_pos]
self.coords = coords or [0, 0]

Simplify this)

class BaseRobot:

def __init__(self, name: str, weight: int,
coords: list | None = None) -> None:

Choose a reason for hiding this comment

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

Suggested change
coords: list | None = None) -> None:
coords: list[int] | None = None) -> None:

Choose a reason for hiding this comment

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

add here and in all of the code

app/main.py Outdated
self.current_load = current_load

def hook_load(self, cargo: Cargo) -> None:
if cargo.weight <= self.max_load_weight \

Choose a reason for hiding this comment

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

use () instead of \

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.

3 participants