Some refactoring needed?
#7
Ohh Smile
I found something big for refactoringBig Grin
The mobsystem was very C & P ´edBig Grin

http://code.google.com/p/mc-server/source/detail?r=112

Removed bPassiveAggressive
Replaced by cPassiveAggressiveMonster Parentclass
state Aggressive is replaced by AggressiveMonster
and state Passive is replaced by PassiveMonster

This makes it much for easy to add new states because not every behavior is hardcoded in the cMonster class Smile

The cause for looking at it was a bug which caused mobs to follow player in creative mode.
I would had to implement this code for every partially aggressive mob. Now I only had to change the AggressiveMob class Smile
Reply
Thanks given by:


Messages In This Thread
Some refactoring needed? - by Lapayo - 12-26-2011, 02:31 AM
RE: Some refactoring needed? - by mtilden - 12-26-2011, 02:57 AM
RE: Some refactoring needed? - by FakeTruth - 12-26-2011, 02:58 AM
RE: Some refactoring needed? - by Lapayo - 12-26-2011, 03:13 AM
RE: Some refactoring needed? - by FakeTruth - 12-26-2011, 03:34 AM
RE: Some refactoring needed? - by Lapayo - 12-26-2011, 03:35 AM
RE: Some refactoring needed? - by Lapayo - 12-26-2011, 08:52 AM
RE: Some refactoring needed? - by mtilden - 12-26-2011, 04:10 PM
RE: Some refactoring needed? - by mtilden - 12-26-2011, 07:16 PM
RE: Some refactoring needed? - by FakeTruth - 12-26-2011, 10:41 PM
RE: Some refactoring needed? - by Lapayo - 12-27-2011, 12:02 AM
RE: Some refactoring needed? - by mtilden - 12-27-2011, 12:20 AM
RE: Some refactoring needed? - by rs2k - 12-27-2011, 02:42 AM
RE: Some refactoring needed? - by Lapayo - 12-27-2011, 02:46 AM
RE: Some refactoring needed? - by FakeTruth - 12-27-2011, 02:50 AM
RE: Some refactoring needed? - by Lapayo - 12-27-2011, 02:51 AM
RE: Some refactoring needed? - by Lapayo - 07-11-2012, 01:55 AM
RE: Some refactoring needed? - by xoft - 07-11-2012, 02:33 AM
RE: Some refactoring needed? - by Lapayo - 07-16-2012, 06:51 AM
RE: Some refactoring needed? - by xoft - 07-16-2012, 07:07 AM
RE: Some refactoring needed? - by Lapayo - 07-16-2012, 03:11 PM
RE: Some refactoring needed? - by NiLSPACE - 07-16-2012, 06:09 PM
RE: Some refactoring needed? - by Lapayo - 07-17-2012, 01:53 AM
RE: Some refactoring needed? - by NiLSPACE - 07-17-2012, 03:56 AM
RE: Some refactoring needed? - by Lapayo - 07-17-2012, 04:00 AM
RE: Some refactoring needed? - by NiLSPACE - 07-17-2012, 04:15 AM
RE: Some refactoring needed? - by Lapayo - 07-17-2012, 04:21 AM
RE: Some refactoring needed? - by NiLSPACE - 07-17-2012, 04:23 AM
RE: Some refactoring needed? - by xoft - 07-17-2012, 04:25 AM
RE: Some refactoring needed? - by Lapayo - 07-17-2012, 04:41 AM
RE: Some refactoring needed? - by NiLSPACE - 07-17-2012, 04:26 AM
RE: Some refactoring needed? - by xoft - 07-17-2012, 04:48 AM
RE: Some refactoring needed? - by Lapayo - 07-17-2012, 05:40 AM
RE: Some refactoring needed? - by xoft - 07-17-2012, 06:01 PM
RE: Some refactoring needed? - by xoft - 07-17-2012, 10:54 PM
RE: Some refactoring needed? - by Lapayo - 07-18-2012, 12:35 AM



Users browsing this thread: 1 Guest(s)