from typing import List


def collect_values(value_map: dict, include_terminal: bool = False) -> List[float]:
    """Collect value map values.

    Args:
        value_map: dict, value map
        include_terminal: bool, True to include terminal (full board and won states)

    Returns:
        values: list of float
    """

    values = []
    for s in value_map:
        for m in value_map[s]:
            if isinstance(value_map[s][m], dict):
                for a in value_map[s][m]:
                    values.append(value_map[s][m][a])
            elif include_terminal:
                values.append(value_map[s][m])
    return values