def generate_value_property(name):
    """
    Generate a property instance that can be used to represent an entity value.

    Arguments
    ---------
        name : str
            The name of the entity value to represent.

    Returns
    -------
    property
        The generated property.

    """

    @property
    def value_property(entity):
        return getattr(entity, "_" + name)

    @value_property.setter
    def value_property(entity, value):
        value_maximum = getattr(entity, "maximum_" + name)

        # Prohibit the value from exceeding it's maximum or falling below zero.
        if value > value_maximum:
            value = value_maximum

        if value < 0:
            value = 0

        setattr(entity, "_" + name, value)

    return value_property