Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] Context?

[DiscordArchive] Context?

[DiscordArchive] Context?

rektbyfaith
Administrator
0
04-10-2019, 10:02 AM
#1
Archived author: Nix • Posted: 2019-04-10T10:02:31.371000+00:00
Original source

Context?
rektbyfaith
04-10-2019, 10:02 AM #1

Archived author: Nix • Posted: 2019-04-10T10:02:31.371000+00:00
Original source

Context?

rektbyfaith
Administrator
0
04-10-2019, 10:05 AM
#2
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
```
rektbyfaith
04-10-2019, 10:05 AM #2

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
```

rektbyfaith
Administrator
0
04-10-2019, 10:10 AM
#3
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.
rektbyfaith
04-10-2019, 10:10 AM #3

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.

rektbyfaith
Administrator
0
04-10-2019, 10:11 AM
#4
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.
rektbyfaith
04-10-2019, 10:11 AM #4

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.

rektbyfaith
Administrator
0
04-10-2019, 10:22 AM
#5
Archived author: Claudiodfc • Posted: 2019-04-10T10:22:27.141000+00:00
Original source

understood, thanks for the explanation
rektbyfaith
04-10-2019, 10:22 AM #5

Archived author: Claudiodfc • Posted: 2019-04-10T10:22:27.141000+00:00
Original source

understood, thanks for the explanation

rektbyfaith
Administrator
0
04-10-2019, 10:22 AM
#6
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
rektbyfaith
04-10-2019, 10:22 AM #6

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

rektbyfaith
Administrator
0
04-10-2019, 10:28 AM
#7
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
rektbyfaith
04-10-2019, 10:28 AM #7

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

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)