[DiscordArchive] Context?
[DiscordArchive] Context?
Archived author: Nix • Posted: 2019-04-10T10:02:31.371000+00:00
Original source
Context?
Archived author: Claudiodfc • Posted: 2019-04-10T10:05:20.003000+00:00
Original source
what's the diference with
```
EnterCombat(Unit /*who*/)
```
and
```
EnterCombat(Unit /*who*/) override
```
Archived author: Nix • Posted: 2019-04-10T10:10:33.242000+00:00
Original source
So the base concept of OOP is to build your structure around objects. The thing about objects is that they're rarely just one thing, like a dog for example can bark and a cat can say meow, while both being animals, so implemented both bark and meow would be bad for multiple reasons. The solution is to have base methods, for example the base class animal might have a pure virtual function called MakeSound(). If we make a class called Dog and inherit the base class animal, we can override MakeSound() to play the Bark sound file, and if we make a class called Cat and inherit the base class animal, we can override MakeSound() to play the Meow sound file.
Archived author: Nix • Posted: 2019-04-10T10:11:02.395000+00:00
Original source
In this case I'm pretty sure you're dealing with AI, so there is a base AI class which contains most of the mutual needs between different types of AI, and a few virtual functions to allow specific behavior for a given type of AI.
Archived author: Claudiodfc • Posted: 2019-04-10T10:22:27.141000+00:00
Original source
understood, thanks for the explanation
Archived author: Claudiodfc • Posted: 2019-04-10T10:22:52.075000+00:00
Original source
So it's more of a good practice than a very important thing
Archived author: Nix • Posted: 2019-04-10T10:28:54.946000+00:00
Original source
I would say its one of those good practices that become important the larger the project is, if you do decide to do OOP