I learned a lot from your cmake series. I believe this will be also great.
@CodeTechandTutorials2 жыл бұрын
I hope so too!
@IsaacCode95 Жыл бұрын
great video !, loved the explanations, 14:45 Catdawg!
@reverse_shell2 жыл бұрын
Glad I paid attention to your pointer lesson... this needs some cleanup. :D Factory Pattern is pretty cool! The Clone() method was pretty dope.
@CodeTechandTutorials2 жыл бұрын
Glad you liked it!
@cesarb.yamasato1266 Жыл бұрын
Isn't it possible to make a spawner interface with a spawn() method and then the spawn classes define it (like dogSpawner and catSpawner) so you can have just a specific creature spawner be used as a generic creature spawner?
@muonline20672 жыл бұрын
maybe my question is very noob, but I saw in the github, the author uses many times new operator, but he never uses delete them or it? So why? Because normally when I read the book they always say that we have to delete the raw pointers to avoid memory leak, but it seems that this problem is not big, because I see that many tutorials, they never care about it.
@michaellundgren6949 Жыл бұрын
The operating system clean up when the program returns and exits. Its not a big deal for these example programs that don't even have many memory allocations anyway. But In a game, you will likely be calling these functions repeatedly in a main game loop and your memory usage will grow out of control if you only allocate and never delete. That is a memory leak.
@abigbagofchips4 ай бұрын
computers now and days the OS can handle it and for small programs it really doesn't matter. It always a great practice to do so, because as your program gets larger the more resources it will consume on the PC. If you never delete anything that is not used, your program will run out of memory that is allocated to it. PCs today, probably would just crash your program, but back in the 1900s it would crash the whole computer or worse write to protected memory that shouldn't be touch (Really rare I only heard stories). You should always call delete if you use new, or use smart pointers.
@sam-pd7su2 жыл бұрын
Is not against oop principles doings cast?
@prezadent12 жыл бұрын
This is a simple factory / factory object example. It's not a pattern. Congrats on not calling it the factory method pattern or the abstract factory pattern but since this is the first video in a design patterns series, you really need to get this right. And at least 2/3 of the videos on youtube are wrong about factories and factory patterns. Stick to the GoF book.