Explorar el Código

Code/comment cleanup

master
achmizs hace 4 años
padre
commit
348c26aa7d
Se han modificado 1 ficheros con 10 adiciones y 7 borrados
  1. 10
    7
      SA_DiceFormatter.m

+ 10
- 7
SA_DiceFormatter.m Ver fichero

// only if error reporting is enabled. // only if error reporting is enabled.
if (expression.result != nil) { if (expression.result != nil) {
[formattedString appendFormat:@" = %@", expression.result]; [formattedString appendFormat:@" = %@", expression.result];
} else if (_legacyModeErrorReportingEnabled == YES &&
expression.errorBitMask != 0) {
[formattedString appendFormat:((__builtin_popcountl(expression.errorBitMask) == 1) ? @" [ERROR: %@]" : @" [ERRORS: %@]"),
} else if ( _legacyModeErrorReportingEnabled == YES
&& expression.errorBitMask != 0) {
[formattedString appendFormat:((__builtin_popcountl(expression.errorBitMask) == 1)
? @" [ERROR: %@]"
: @" [ERRORS: %@]"),
[SA_DiceFormatter descriptionForErrors:expression.errorBitMask]]; [SA_DiceFormatter descriptionForErrors:expression.errorBitMask]];
} }
is printed along with the rolls. is printed along with the rolls.
For this reasons, when we recursively retrieve the string representations For this reasons, when we recursively retrieve the string representations
of sub-expressions, we call this method, not legacyStringFromExpression:.
of sub-expressions, we call this method, not -[legacyStringFromExpression:].
*/ */


switch (expression.type) { switch (expression.type) {
} }


NSMutableArray <NSString *> *errorDescriptions = [NSMutableArray array]; NSMutableArray <NSString *> *errorDescriptions = [NSMutableArray array];
for (int i = 0; i <= 18; i++) {
if ((errorBitMask & 1 << i) == 0) continue;
NSString *errorName = NSStringFromSA_DiceExpressionError((SA_DiceExpressionError) 1 << i);
for (int i = 0; i <= 19; i++) {
if ((errorBitMask & (1 << i)) == 0)
continue;
NSString *errorName = NSStringFromSA_DiceExpressionError((SA_DiceExpressionError) (1 << i));
[errorDescriptions addObject:(_errorDescriptions[errorName] ?: errorName)]; [errorDescriptions addObject:(_errorDescriptions[errorName] ?: errorName)];
} }



Cargando…
Cancelar
Guardar