Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualEWClay

Posted 20 March 2013 - 04:28 AM

I don't know UnrealScript or your design, but here's how it looks to me:

All the variables you mention are not part of the game state, but are fixed properties of the weapon type. It would be better to separate that data and store it once per weapon type.

As it's just data there's no need for inheritance. If a particular weapon doesn't use one of the fields, that's fine.

For the code, the usual way to change the behaviour of a base class is to make the function virtual and override it.

#1EWClay

Posted 20 March 2013 - 04:28 AM

I don't know UnrealScript or you design, but here's how it looks to me:

All the variables you mention are not part of the game state, but are fixed properties of the weapon type. It would be better to separate that data and store it once per weapon type.

As it's just data there's no need for inheritance. If a particular weapon doesn't use one of the fields, that's fine.

For the code, the usual way to change the behaviour of a base class is to make the function virtual and override it.

PARTNERS