from nz.org.riskscape.engine.types import Struct, Types

ID = 'flood_loss'
DESCRIPTION = 'declares a complete loss if flood depth over 1'

ARGUMENT_TYPES = [Struct.of('value', Types.FLOATING), Struct.of('depth', Types.FLOATING)]
RETURN_TYPE = Types.FLOATING

def function(exposure, flood):
  if flood['depth'] > 1.0:
    return exposure['value']
  return 0.0
