/**
 * \file core/spoms/interpretationbackup.cpp
 * \date 16/02/2026
 * \author Aurélien Berthier, BENOIST Emile, TESSIER Dominique
 * \brief store alignment interpretations for precise alignment
 */


/*
 * PeptidOMS, Spectra to protein alignment tool
 * Copyright (C) 2026  Olivier Langella
 * <olivier.langella@cnrs.fr>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "interpretationbackup.h"
#include <QDebug>

namespace pappso
{
namespace spoms
{

InterpretationBackup::InterpretationBackup(int initialization_score)
{
  score = initialization_score;
}

InterpretationBackup::InterpretationBackup(const InterpretationBackup &other)
{
  line_number   = other.line_number;
  column_number = other.column_number;
  score         = other.score;
}
InterpretationBackup::~InterpretationBackup()
{
}


void
InterpretationBackup::tryImprove(int score_in,
                                 int line_number_in,
                                 int column_number_in)
{
  // qDebug() << " old score:" << score << " new score " << score_in << " "
  //          << line_number_in << " " << column_number_in;
  if(score < score_in)
    {
      line_number   = line_number_in;
      column_number = column_number_in;
      score         = score_in;
    }
}

int
InterpretationBackup::getLineNumber() const
{
  return line_number;
}

int
InterpretationBackup::getColumnNumber() const
{
  return column_number;
}

int
InterpretationBackup::getScore() const
{
  return score;
}

} // namespace spoms
} // namespace pappso
