Understanding concepts like inheritance, polymorphism, and abstraction can be a challenge for beginners, especially when typical examples like shapes and vehicles don't feel relevant to real-world software development.
In this video, Eric simplifies these concepts by demonstrating them through a practical example: building a role-playing game inventory system. You'll learn how to create base classes for items and containers, allowing any item to be stored in any container. From there, we’ll extend the container base class to incorporate restrictions based on item weight and type.
We’ll also cover writing unit tests using the XUnit test library to ensure everything works as expected.
Stick around until the end for a special refactoring challenge to put your skills to the test!
💽 The source code is available at: https://github.com/eswise/SFYouTubeCode
💬 Did you like this video? Let us know in the comments below!
---------------
✅ Click here to subscribe to Skill Foundry now!
/ @skillfoundryio
👩💻 Join Our Coding Community on Discord!
Connect with peers, talk about tech, and share your learning journey.
Join here: / discord
📍 Like the Channel? Sign up for the Newsletter!
https://newsletter.skillfoundry.io/
💥 Learn to Code the Right Way! Our full-stack C# developer pathway provides over 700 learner hours of effort and rigor with over 80 practice projects, 150 lessons, and over a dozen capstone projects that challenge you to design and build applications from scratch.
https://www.skillfoundry.io/
📬 Contact us anytime!
[email protected]
---------------
Welcome to the official YouTube channel of Skill Foundry! With over 20 years of professional experience, Eric and the team deliver unbiased information and advice to beginners and early career developer professionals.
Learn to code the right way!
We believe that highly technical skills are learned best with a combination of real subject matter experts, learning science professionals, well written curriculum and projects, compassionate mentorship, and an enthusiastic community.
Our team has crafted and delivered technical training for over a decade, creating curriculums for Fortune 500 companies, universities, and coding bootcamps across the globe. This rigorous curriculum is now available direct to individuals for the first time.
So, hit the subscribe button and turn on the notification bell so you won't miss any new videos! 🔔
---------------
#SkillFoundry #codingtutorials #inheritance #rpgcoding
---------------
Common Questions:
What is inheritance in object-oriented programming?
How does polymorphism work in C#?
What is abstraction in programming and why is it important?
How can you create a simple inventory system for an RPG?
What are base classes and how do they function in OOP?
How can you extend a base class in C# to add restrictions?
What is the purpose of unit testing in software development?
How do you write unit tests using XUnit in C#?
What is a refactoring challenge, and how does it help improve coding skills?
How do inheritance and polymorphism work together in object-oriented programming?
---------------
0:00 Intro
1:00 Today's Goals: Understanding Inheritance and Polymorphism
2:09 Setting Up: Creating Class Libraries and Unit Test Projects
4:20 Establishing the Item Base Class: Using Polymorphism in RPGs
6:02 Working with Enums in C#
7:02 Abstract Classes Explained: Planning Ahead in Your Code
7:40 Demonstrating Inheritance: Applying It to Our Tutorial
10:55 Adding Internal Classes While Inheriting Items
15:31 Creating Our Containers: Chests with Limits
18:14 Adding Behaviors to Our Containers
24:55 Inheriting Behavior: The Treasure Chest and Constructor
25:22 Let's Run Some Tests! [FACT]
28:22 How to Write Assertions in Your Code
29:07 Running Our Tests
29:50 Removing Items from Our Chest: Test 2
32:22 Ensuring Removed Items Return Null
34:33 Handling Full Chests: Returning False When Full (Test 3)
36:30 Restricting Chest Contents Using Enums: Handling Right and Wrong Items
49:25 Creating Another Restricted Container: Using Item Weights (Like in Fallout)
1:00:03 Final Thoughts and Takeaways
1:01:20 A Final Challenge: Applying Concepts to Real-World Scenarios
Смотрите видео Inheritance Explained with a Role-Playing Game Inventory System онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Skill Foundry 30 Август 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,141 раз и оно понравилось 41 людям.