@Override
    public boolean isDone(Game game)
    {
        //END Condition: there must be in the game:
        //  * exactly limit amount of sprites of type stype1
        //  * exactly subTypesNum number of subtypes of stype1

        boolean ended = super.isFinished(game);
        if(ended)
            return true;

        int countAcum = 0;

        if(itype1 != -1) countAcum += game.getNumSprites(itype1) - game.getNumDisabledSprites(itype1);

        if(countAcum == limit && canEnd) {

            ArrayList<Integer> subtypes = game.getSubTypes(itype1);
            int countAcumSubTypes = 0;
            for (Integer subtype : subtypes) {

                int count = (game.getNumSprites(subtype) - game.getNumDisabledSprites(subtype));
                if(count > 0)
                {
                    if(game.getSpriteGroup(subtype) != null) //This avoids non-terminal types
                    {
                        countAcumSubTypes += count > 0 ? 1 : 0;
                    }
                }
            }

            if(countAcumSubTypes == subTypesNum) {
                countScore(game);
                return true;
            }
        }


        return false;
    }