#ifndef SEEN_ENTRY_H
#define SEEN_ENTRY_H

#include 
#include 

#include "percent.h"
#include "date.h"

namespace Seen
{

class Entry
{
public:
	/**
	 * @brief Every entry must have at least one date, otherwise its
	 * useless and was never seen :-)
	 *
	 * @param date to add initially
	 */
	Entry();

	std::string get_title() const;
	void set_title(std::string const & title);

	void add_date(Date const & date)
	{
		m_dates.push_back(date);
	}

	typedef std::vector::const_iterator const_date_iterator;
	const_date_iterator dates_begin() const
	{
		return m_dates.begin();
	}

	const_date_iterator dates_end() const
	{
		return m_dates.end();
	}

	typedef std::vector::const_iterator const_string_iterator;

	/**
	 * @brief Add an available spoken language of the movie.
	 *
	 * Might contain additional text describing the quality of the
	 * audio track.
	 *
	 * @param language will be trimmed and added
	 */
	void add_language(std::string const & language);

	const_string_iterator languages_begin() const
	{
		return m_languages.begin();
	}

	const_string_iterator languages_end() const
	{
		return m_languages.end();
	}

	/**
	 * @brief Add an available subtitle.
	 *
	 * Might contain additional text describing the quality of the
	 * subtitle.
	 *
	 * @param subtitle will be trimmed and added
	 */
	void add_subtitle(std::string const & subtitle);

	const_string_iterator subtitles_begin() const
	{
		return m_subtitles.begin();
	}

	const_string_iterator subtitles_end() const
	{
		return m_subtitles.end();
	}

	/**
	 * @brief Add a note.
	 *
	 * @param note will be trimmed and added
	 */
	void add_note(std::string const & note);

	const_string_iterator notes_begin() const
	{
		return m_notes.begin();
	}

	const_string_iterator notes_end() const
	{
		return m_notes.end();
	}

	// TODO: hold all scores together

	/**
	 * @brief Obviously it is not irrelevant how the actors do their job
	 *
	 * 5% of total rating
	 *
	 * @return Score how actors played
	 */
	Percent get_actors_score() const
	{
		return m_actors_score;
	}

	void set_actors_score(Percent const & score)
	{
		m_actors_score = score;
	}

	/**
	 * @brief How did the special effects look like?
	 *
	 * 5% of total rating
	 *
	 * @return Score of special effects
	 */
	Percent get_special_effect_score() const;

	/**
	 * @brief How thoughtful the movie is and what impression it makes.
	 *
	 * This rating is rather a feeling and even more subjective then
	 * the others.
	 *
	 * 20% of total rating (to be changed to 30%)
	 *
	 * @return 
	 */
	Percent get_mediate_score() const;

	/**
	 * @brief How the good the plot is.
	 *
	 * 30% of total rating (to be changed to 20%)
	 *
	 * @return 
	 */
	Percent get_plot_score() const;

	/**
	 * @brief How much in the movie happens.
	 *
	 * Action is not meant to be gunfire. It could be anything, also
	 * dialogs. The opposite would be if the movie was boring.
	 *
	 * 5% of total rating
	 *
	 * @return 
	 */
	Percent get_action_score() const;

	/**
	 * @brief How often the film turned and how surprising those
	 * turns are.
	 *
	 * 15% of total rating
	 *
	 * @return 
	 */
	Percent get_surprise_score() const;

	/**
	 * @brief How much effort the creators put into the film.
	 *
	 * 20% of total rating
	 * (to be changed for independence films, e.g. removed)
	 *
	 * @return 
	 */
	Percent get_monumental_score() const;

	/**
	 * @brief All above scores summed up together.
	 *
	 * @return The total score of this film.
	 */
	Percent get_total_score() const;

private:
	std::string m_title; ///< will not be serialized
	std::vector m_languages;
	std::vector m_subtitles;
	std::vector m_dates;
	Percent m_actors_score;
	Percent m_special_effect_score;
	Percent m_mediate_score;
	Percent m_plot_score;
	Percent m_action_score;
	Percent m_surprise_score;
	Percent m_monumental_score;
	std::vector m_notes;
};

std::ostream & operator<<(std::ostream & os, Entry const & entry);
std::istream & operator>>(std::istream & is, Entry & entry);

}

#endif
Fr Jul 30 13:54:24 CEST 2021
patent_button.gif valid-html401.png elektra.jpg fsfe-logo.png valid-css.png vim.gif anybrowser.gif