Skip to main content
Grammar fixes, slight clarifications/format fixes (mostly moving 'approved' comment into the answer)
Source Link

InheritanceThe idea that inheritance must be avoided is simply wrong.
There

There exists a coding principle called Composition over InheritanceComposition over Inheritance. It says, that you can achieve simmilar resultsthe same things with composition, and it's preferable, because you can reuse some of the code. Source:See SE-StackexchangeWhy should I prefer composition over inheritance? also look here at the other Answers.
Wikipedia

I have to say iI like your weapon classes and would it do the same way. But i haven't made a game by now...
As

As pointed out by James Trotter, composition could have some advantages, especially in the flexibility at runtime to change how the weapon works. This would be possible with inheritance, but it's more difficult.

Inheritance must be avoided is simply wrong.
There exists a coding principle called Composition over Inheritance. It says, that you can achieve simmilar results with composition, and it's preferable, because you can reuse some of the code. Source: SE-Stackexchange also look here at the other Answers.
Wikipedia

I have to say i like your weapon classes and would it do the same way. But i haven't made a game by now...
As pointed out by James Trotter, composition could have some advantages.

The idea that inheritance must be avoided is simply wrong.

There exists a coding principle called Composition over Inheritance. It says that you can achieve the same things with composition, and it's preferable, because you can reuse some of the code. See Why should I prefer composition over inheritance?

I have to say I like your weapon classes and would it do the same way. But i haven't made a game by now...

As pointed out by James Trotter, composition could have some advantages, especially in the flexibility at runtime to change how the weapon works. This would be possible with inheritance, but it's more difficult.

added 94 characters in body
Source Link
Linaith
  • 536
  • 3
  • 9

Inheritance must be avoided is simply wrong.
There exists a coding principle called Composition over Inheritance. It says, that you can achieve simmilar results with composition, and it's preferable, because you can reuse some of the code. Source: SE-Stackexchange also look here at the other Answers.
Wikipedia

I have to say i like your weapon classes and would it do the same way. But i haven't made a gameI have to say i like your weapon classes and would it do the same way. But i haven't made a game by now...
As pointed out by now..James Trotter, composition could have some advantages.

Inheritance must be avoided is simply wrong.
There exists a coding principle called Composition over Inheritance. It says, that you can achieve simmilar results with composition, and it's preferable, because you can reuse some of the code. Source: SE-Stackexchange also look here at the other Answers.
Wikipedia

I have to say i like your weapon classes and would it do the same way. But i haven't made a game by now...

Inheritance must be avoided is simply wrong.
There exists a coding principle called Composition over Inheritance. It says, that you can achieve simmilar results with composition, and it's preferable, because you can reuse some of the code. Source: SE-Stackexchange also look here at the other Answers.
Wikipedia

I have to say i like your weapon classes and would it do the same way. But i haven't made a game by now...
As pointed out by James Trotter, composition could have some advantages.

deleted 15 characters in body
Source Link
Linaith
  • 536
  • 3
  • 9

Inheritance must be avoided is simply wrong.
There exists a coding principle called Composition over Inheritance. It says, that you can achieve simmilar results with composition, and it's preferable, because you can reuse some of the code. Source: SE-Stackexchange also look here at the other Answers.
Wikipedia

I have to say i like your weapon classes and would it do the same way. But i have to say, i haven't made a game by now...

Inheritance must be avoided is simply wrong.
There exists a coding principle called Composition over Inheritance. It says, that you can achieve simmilar results with composition, and it's preferable, because you can reuse some of the code. Source: SE-Stackexchange also look here at the other Answers.
Wikipedia

I have to say i like your weapon classes and would it do the same way. But i have to say, i haven't made a game by now...

Inheritance must be avoided is simply wrong.
There exists a coding principle called Composition over Inheritance. It says, that you can achieve simmilar results with composition, and it's preferable, because you can reuse some of the code. Source: SE-Stackexchange also look here at the other Answers.
Wikipedia

I have to say i like your weapon classes and would it do the same way. But i haven't made a game by now...

Source Link
Linaith
  • 536
  • 3
  • 9
Loading