Skip to content

Conversation

@dhyantsoni
Copy link

Please ensure your pull request adheres to the following requirements

Branch Name Pull Request

  • List the different exercises you completed
  • Inheritance
  • PokemonProject

Notes

  • Any takeaways from the exercises:
    • What was something new from these exercises you haven't see before
    • If you solved an activity in a different manner than the answers, describe it!
  • I learned a lot about OOP and all of the principles of OOP

Pokemon Answers

  • Explain why Pokemon should be an abstract class

    • Pokemon should be an abstract class as it is the blue print to other classes or in this context, other pokemon.
  • Explain why inheriting from Pokemon is useful

    • Inheriting from Pokemon is useful as it provides structure your code and makes adding changes a breeze.
  • Explain an example of method polymorphism in your code

    • I used polymorphism when I set up an abstract method attack which was later overridden based on the needs of the class.
  • Explain an example of subtype polymorphism in your code

    • I used subtype polymorphism by calling another method, "take_damage" inside the attack method
  • Explain why you made one of your methods public

    • I made one of my method public so that it could be accessed by a different class
  • Explain why you made one of your instance variables private

    • I made a lot of my instance variables private to restrict access outside the class so it isn't tampered hence the structure of the project being more clean and less prone to unexpected bugs.

@NoahSimon8
Copy link

Awesome stuff!

Your explanations are right on and your code is great. Just one little thing though:
image

This is not calling the take damage method of the opposing pokemon! It's calling it on itself! You need to do opposite_pokemon.takeDamage(5);

But again, great work! Excited to see you take on robot coding

@dhyantsoni
Copy link
Author

I must have missed that, thank you the feedback!

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.

4 participants