using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ProjetDotNet.metier;

namespace ProjetDotNet.COR
{
    /*
     * Gère le chargement d'un polygone
     */
    public class CORChargerPolygone:CORChargerForme
    {
        public CORChargerPolygone(CORChargerForme suivant):base(suivant)
        {

        }

        public CORChargerPolygone(): base()
        {

        }

        /*public override Forme charge(int id)
        {
            bool bonType = this.CONNEXION.DAO_POLYGONE.isSameType(id);
            if (bonType)
            {
                Polygone t = this.CONNEXION.DAO_POLYGONE.charge(id);
                return t;
            }
            else
            {
                return this.GetSuccessor().charge(id);
            }
        }*/

        public override Forme charge(int id,string nomFigure)
        {
            bool bonType = this.CONNEXION.DAO_POLYGONE.isSameType(id,nomFigure);
            if (bonType)
            {
                Polygone t = this.CONNEXION.DAO_POLYGONE.charge(id, nomFigure);
                return t;
            }
            else
            {
                return this.GetSuccessor().charge(id, nomFigure);
            }
        }

        public void save(Polygone forme)
        {

            if (true)
            {
                this.CONNEXION.DAO_POLYGONE.save(forme);
                
            }
            else
            {
                //return this.GetSuccessor().charge(id);
            }
        }
    }
}
