def reward_win_player1_pov(old_state, new_state):
    """
    +1/-1 reward based on who won the game, from the POV of player1:
        +1 if player1 won the game
        -1 if player1 lost the game
        0 if game was tie or game has not ended
    """
    if new_state.winner is not None:
        if new_state.winner == 1:
            return 1
        elif new_state.winner == 2:
            return -1
        elif new_state.winner == 0:
            return 0
        else:
            raise ValueError('state.winner was %d' % new_state.winner)
    return 0
