Phase10/src/com/github/s7uxn37/phase10/Intelligence.java
/**
     * Removes the card from its previous location and updates the stack accordingly
     * @param c The card that was moved
     * @param m The move the card was subject to
     * @return True if the removal was successful, false otherwise
     */
Removes the card from its previous location and updates the stack accordingly
@param c The card that was moved
@param m The move the card was subject to
@return True if the removal was successful, false otherwise
Removes the card from its previous location and updates the stack accordingly @param c The card that was moved @param m The move the card was subject to @return True if the removal was successful false otherwise
private boolean handleFrom(Card c, Move m) {
        int opponentIndex = -1;
        switch (m.from) {
            case FACE_DOWN: 
                faceDown.remove(0);
                log(
                        "unknown face down card removed, stack shortened"
                );
                break;
            case FACE_UP:
                if (!handleRemove(faceUp, "face up", c, 1))
                    return false;
                break;
            case SELF: 
                try {
                    player.remove(player.indexOf(c));
                    log(
                            "own card removed"
                    );
                } catch (IndexOutOfBoundsException e) {
                    log(
                            "ERROR: own card not found, although all cards known"
                    );
                    return false;
                }
                break;
            case PLAYER_1:
                opponentIndex = 0;
                break;
            case PLAYER_2:
                opponentIndex = 1;
                break;
            case PLAYER_3:
                opponentIndex = 2;
                break;
            case PLAYER_4:
                opponentIndex = 3;
                break;
            case PLAYER_5:
                opponentIndex = 4;
                break;
            default:
                break;
        }
        if (opponentIndex != -1) {
            if (!handleRemove(opponents[opponentIndex], "opponent", c, 0))
                return false;
        }
        return true;
	}
private boolean handleFrom ( Card c , Move m ) { int opponentIndex = - 1 ; switch ( m . from ) { case FACE_DOWN : faceDown . remove ( 0 ) ; log ( "unknown face down card removed, stack shortened" ) ; break ; case FACE_UP : if ( ! handleRemove ( faceUp , "face up" , c , 1 ) ) return false ; break ; case SELF : try { player . remove ( player . indexOf ( c ) ) ; log ( "own card removed" ) ; } catch ( IndexOutOfBoundsException e ) { log ( "ERROR: own card not found, although all cards known" ) ; return false ; } break ; case PLAYER_1 : opponentIndex = 0 ; break ; case PLAYER_2 : opponentIndex = 1 ; break ; case PLAYER_3 : opponentIndex = 2 ; break ; case PLAYER_4 : opponentIndex = 3 ; break ; case PLAYER_5 : opponentIndex = 4 ; break ; default : break ; } if ( opponentIndex != - 1 ) { if ( ! handleRemove ( opponents [ opponentIndex ] , "opponent" , c , 0 ) ) return false ; } return true ; }
Removes the card from its previous location and updates the stack accordingly
 @param c The card that was moved
 @param m The move the card was subject to
 @return True if the removal was successful, false otherwise
Removes the card from its previous location and updates the stack accordingly @param c The card that was moved @param m The move the card was subject to @return True if the removal was successful false otherwise
// all cards unknown
 // all cards known
 // useless, but stops warnings ;)
