How to use the Decorator Pattern (Card Game Example)

  Рет қаралды 6,611

git-amend

git-amend

Күн бұрын

Unity C# Architecture: Learn the Decorator Programming Pattern building Card Game mechanics where bonus cards decorate battle cards.
🔔 Subscribe for more Unity Tutorials / @git-amend
#unity3d #gamedev #indiedev
▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
0:00 Decorator Pattern
1:43 Cards and Card Decorators
4:00 Decorators in Action
Check out: www.artstation.com/katgrabowska
Assets Shown In This Video (Affiliate Links)
assetstore.unity.com/packages...
Follow me!
linktr.ee/gitamend

Пікірлер: 33
@git-amend
@git-amend 9 ай бұрын
24 hour challenge - think of a SEALED class that you could extend using the Decorator Pattern! Can't be StringBuilder; that's too easy! Post in the comments!
@brodgers123
@brodgers123 9 ай бұрын
Dude... you are quickly becoming my favorite KZfaqr. #frfr
@git-amend
@git-amend 9 ай бұрын
Wow thanks!
@Cloud-Yo
@Cloud-Yo 4 ай бұрын
Went through this tutorial and I gotta admit that some of it still eludes me. Its not so much the logic, but the re-application of something similar in a different context. Nonetheless, this was another amazing video, thanks.
@git-amend
@git-amend 4 ай бұрын
Great to hear!
@Aliberation
@Aliberation 9 ай бұрын
Nice, been wanting to build a turn based game and this might be very useful to create combos between characters. Thanks as always! ❤
@git-amend
@git-amend 9 ай бұрын
Right on! Sounds great!
@anasmostefaoui3027
@anasmostefaoui3027 9 ай бұрын
Your videos are a pleasure to watch, the way you demystify designs patterns and apply them to game dev is very interesting. It will be interesting to see more patterns in this series, maybe a video about command pattern and how it can be used in game dev? I tried to use it once for fighting game to create combo and move list, I would love to see your approach to it.
@git-amend
@git-amend 9 ай бұрын
Glad you like them! I've had a few comments about the Command pattern now, so I'll definitely make a video about it soon! Thanks!
@techdave99
@techdave99 9 ай бұрын
Thanks for another great video. I'll have to watch it a few times as there was a lot of stuff covered. Want to see what you do when you make your singleton video. I see a lot very simple methods done and always wonder if they are being thorough and actually covering what's needed.
@git-amend
@git-amend 9 ай бұрын
Thanks! For sure, Singletons are on my list of videos to do!
@mohamadkh221
@mohamadkh221 6 ай бұрын
🔥🔥🔥
@halfling.2344
@halfling.2344 7 ай бұрын
it was realy helpfull explanation and example, thank you so much. I also would like to see singleton from you as soon as possible :) your content is great, happy that i discovered it
@git-amend
@git-amend 7 ай бұрын
Thanks! Haha, yes Singleton is in the pipeline... the Patterns series wouldn't be complete without that one!
@halfling.2344
@halfling.2344 7 ай бұрын
happy to hear that ^^ are you also considering a complete game tutorial to explain which pattern or technique to use where . It would be great if you can build a game from zero with explanation of the architechture@@git-amend
@ethanwasme4307
@ethanwasme4307 7 ай бұрын
make UML graphs great again! I'm strictly a hobbyist and learning UML and design patterns did so much for my understanding of programming
@jvizcode4845
@jvizcode4845 7 ай бұрын
Amaizing, thanks for making Unity videos. The community needs you. Btw, the Decorator Pattern is kinda like working with a Monad? The final result seems to work like one.
@git-amend
@git-amend 7 ай бұрын
Thanks for the kind words! Good observation about the Decorator Pattern and Monads. They do indeed share a conceptual similarity in that they both involve wrapping or augmenting functionality. 👍
@vietdungdev
@vietdungdev 9 ай бұрын
I really like these types of videos, they help improve game development skills to a new level. It's also very concise, saving a lot of time.
@git-amend
@git-amend 9 ай бұрын
Thank you!
@Lago06
@Lago06 9 ай бұрын
Clean and concise as every video in this series so far! Any tips on additional learning resources (books, course, etc.) that teach design patterns and code architecture (preferable in terms of game development) as understandable as you do? Thanks for your much appreciated effort, looking forward to any future videos!
@git-amend
@git-amend 9 ай бұрын
Thank you! I've learned the most about patterns from experience as a software engineer, and not from a book or course. That being said, there is one good website I will recommend. While not specific to Game Dev, I think that the refactoring.guru site is a great resource no matter what type of programming you are doing.
@Lago06
@Lago06 9 ай бұрын
@@git-amend Thank you very much!
@rofu8096
@rofu8096 5 ай бұрын
8:50 a man of his word 😎
@git-amend
@git-amend 5 ай бұрын
Haha yea finally
@Hazzel31337
@Hazzel31337 2 ай бұрын
now i want to make a card game ^^
@git-amend
@git-amend 2 ай бұрын
Nice, go for it!
@nerdin8or
@nerdin8or 9 ай бұрын
Very cool video as usual! Still not as easy to see where I could use this pattern as it was for builders and factories, but I understand decorators much better now.
@git-amend
@git-amend 9 ай бұрын
Awesome, thanks!
@shun6284
@shun6284 5 ай бұрын
Can you elaborate when to use the Decorator vs Strategy Pattern? They almost like do the same thing like you can make different Card Strategy base on your video.
@git-amend
@git-amend 5 ай бұрын
The Decorator pattern lets you add new features to an object without changing its structure by wrapping it inside another object that provides the extra functionality. The Strategy pattern lets you switch out the core logic or algorithm of an object by encapsulating different behaviors and making them easily interchangeable. Essentially, Decorator changes what an object can do, while Strategy changes how an object does it.
@shun6284
@shun6284 5 ай бұрын
@@git-amend I see so it is like: Decorator - I can Attack and add more functionality to it. Strategy - I can use that Attack and change how it will do it.
How to use the Command Pattern (Skill Combos Example)
11:08
git-amend
Рет қаралды 7 М.
Design Patterns: Decorator
17:21
Microsoft Visual Studio
Рет қаралды 25 М.
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 30 МЛН
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 76 МЛН
Unity Playables is Actually a Game-Changer
13:47
git-amend
Рет қаралды 6 М.
3 Game Programming Patterns WE ACTUALLY NEED.
14:13
Jason Weimann
Рет қаралды 13 М.
Change Behaviors with the Strategy Pattern - Unity and C#
8:07
One Wheel Studio
Рет қаралды 38 М.
Decorator Design Pattern
12:57
Derek Banas
Рет қаралды 422 М.
Simplest Decorator Design Pattern in C#
10:55
Code Radiance
Рет қаралды 25 М.
Game Programming Patterns in Godot: The Command Pattern
14:41
GameDev w/ David
Рет қаралды 14 М.
The Power Of Golang's Decorator Pattern
14:09
Anthony GG
Рет қаралды 43 М.