-
-
Save gastrop0d/3074c7836d7fc6f7a6ceffea0fbd90a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool HasAdvantage() | |
{ | |
// Oh god, okay lets go fetch all our modifiers and check them... | |
foreach( Modifier mod in _modifiers ) | |
{ | |
if( mod.GivesAdvantage() ) | |
{ | |
return true; | |
} | |
} | |
// Oh maybe our current action will have something to say? | |
if( _actionControl.currentAction.GivesAdvantage() ) | |
{ | |
return true; | |
} | |
// Don’t forget the perks! | |
foreach( Perk perk in _perks ) | |
{ | |
if( perk.GivesAdvantage() ) | |
{ | |
return true; | |
} | |
} | |
// … | |
// On and on it goes… | |
// … | |
// ...aaaand our function is 100+ lines long. | |
// See you next time the design calls for another addition to this function! | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment