#include <iostream>
#include "Tomate.h"
#include "Poivron.h"
#include "AssietteCrudites.h"

using namespace std;

static void testPartie2_1();
static void testPartie2_2();
static void testPartie2_3();
static void testPartie2_4();
static void testPartie3();

int main()
{
    testPartie2_1();
    testPartie2_2();
    testPartie2_3();
    testPartie2_4();
    /*testPartie3();*/

    return 0;
}


/// PARTIE 2 question 1
static void testPartie2_1()
{
    Crudite * pdt = new Poivron(0.3, 10);
    Crudite * c = new Tomate(0.25, 30);
    pdt -> print();
    c -> print();
}

/// PARTIE 2 question 2
static void testPartie2_2()
{
    AssietteCrudites s = AssietteCrudites();
    s.add(new Poivron(0.3, 10));
    s.add(new Tomate(0.25, 30));
    s.print();
    s.add(new Poivron(0.500));
    s.add(new Poivron(0.150));
    s.add(new Tomate(0.20, 25));
    s.add(new Poivron(0.450, 2));
    s.print();
}

/// PARTIE 2 question 3
static void testPartie2_3()
{
    AssietteCrudites s = AssietteCrudites();
    s.add(new Poivron(0.3, 10));
    s.add(new Tomate(0.25, 30));
    cout << "Poids des epluchures de l'assietteCruditee " << s.getPeelingWeight() << endl; /// 0.065
}

/// PARTIE 2 question 4
static void testPartie2_4()
{
    AssietteCrudites s = AssietteCrudites();
    s.add(new Poivron(0.3, 10));
    s.add(new Tomate(0.25, 30));
    cout << "Poids des epluchures de l'assietteCruditee " << s.getPeelingWeight() << endl; /// 0.065
    Crudite::setPeelingWeight(0.05);
    cout << "Poids des epluchures de l'ssietteCruditee " << s.getPeelingWeight() << endl; /// 0.0375
}
/*
/// PARTIE 3
static void testPartie3()
{
    Poivron p = Poivron(0.3, 10);
    cout << p << " a " << p.getCalories() << " calories." << endl; /// 42 calories
    Tomate c = Tomate(0.25, 30);
    cout << c << " a " << c.getCalories() << " calories." << endl; /// 49 calories
    AssietteCrudites s = AssietteCrudites();
    s.add(&p);
    s.add(&c);
    cout << "L'assietteCruditee a " << s.getCalories() << " calories." << endl; /// 91 calories
}
*/
