-
Notifications
You must be signed in to change notification settings - Fork 1
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
#91 machine erweitern #132
Conversation
# Conflicts: # game/src/backend/area.rs # game/src/backend/gamestate.rs # game/src/machines/machine.rs
# Conflicts: # game/src/backend/area.rs # game/src/backend/gamestate.rs # game/src/backend/movement.rs # game/src/machines/machine.rs # game/src/machines/machine_sprite.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sieht schon gut aus, fix die angemerkten Sachen noch und dann kann man gemeinsam die Sachen fixen und refactoren (PS: cargo clippy ist dein Freund)
pub fn create_machine(&mut self) { | ||
dbg!(format!("create_machine",)); | ||
let new_ms = Mashine::default(self); | ||
self.areas.push(Box::new(new_ms)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bitte nicht die Funktion default nennen wenn man ein Argument übergeben muss
let machine = area.get_graphic(); | ||
let pos = Vec2 { | ||
x: area.get_collision_area().x, | ||
y: area.get_collision_area().y, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vec2::new ist kürzer
game/src/backend/movement.rs
Outdated
info!("In interaction area: {:?}", self.get_interactable()); | ||
let player_ref = &self.player.clone(); | ||
self.get_interactable().unwrap().interact(player_ref); //TODO: change the unwrap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statt unwrap können wir hier
if let Ok(interactable) = self.getinteractable(){ interactable.interact() }
. Das panicken verhindern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
impl GameState { | ||
pub fn create_machine(&mut self) { | ||
dbg!(format!("create_machine",)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aus dem dbg bitte ein Info!() fürs logging
game/src/machines/machine.rs
Outdated
pub struct Maschine { | ||
//gamestate:GameState, | ||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
pub struct Mashine { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Immer noch falsch geschrieben xD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Änderungen sehen gut aus, warte aber noch auf Bene xD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM again
@Nereuxofficial ich will den merge buton clicken weills toll ist