Quote:
Originally Posted by IAmHawtness
If you're talking about a "IsValidMonster" property on the Entity class, I highly disagree. Why would that logic belong to the Entity class? It has absolutely no place there IMO.
Sorry if I misunderstood you
|
Sorry, I was referring to negative logic in general rather than this actual code snippet.
!condition1 and !condition2 and !condition3 type statements are not exactly good form and can really serve to confuse you when looking for issues.
<edit> Yes, exactly what bone is saying but also from a coding style standpoint.
When running conditions you should be checking for what you DO want rather then ruling out everything you DON'T want. When you write all your checks limiting out what you don't want, your code is difficult to skim through and, more seriously, is no longer very expandable as you need to go back and add more negative conditions for every new possibility you add.