checkIfTokenFitsSubRegion function
Map
checkIfTokenFitsSubRegion(
- dynamic subRegion,
- dynamic token,
- dynamic options
)
Implementation
Map checkIfTokenFitsSubRegion(subRegion, token, options) {
Map getSubR = getSubRegionType(subRegion, token);
var type = getSubR['type'];
bool isHundred = getSubR['isHundred'];
if (!subRegion) {
return {'action': START_NEW_REGION, 'type': type, 'isHundred': isHundred};
}
if (canAddTokenToEndOfSubRegion(subRegion, token, impliedHundreds: options)) {
return {'action': ADD, 'type': type, 'isHundred': isHundred};
}
return {'action': START_NEW_REGION, 'type': type, 'isHundred': isHundred};
}