using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FLY.Simulation.Calender.GuRuiShiYe
{
    public class Gage:INotifyPropertyChanged
    {
        public FLY.Simulation.Flyad7.FLYAD7[] FlyAds { get; private set; }


        public GageAd[] GageAds { get; private set; }

        FLY.Simulation.Flyad7.FLYAD7[] flyads;
        GageAd[] gageAds;
        public Gage() { 
            
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public void Init(int devCnt) {
            
            gageAds = new GageAd[devCnt];
            flyads = new Flyad7.FLYAD7[devCnt];
            for (int i = 0; i < devCnt; i++) {
                
                gageAds[i] = new GageAd();
                gageAds[i].Init($"{i:D2}", i > 0 ? gageAds[i - 1].GetFilmValue:null);

                flyads[i] = new Flyad7.FLYAD7($@"{i:D2}\flyad.json");
                flyads[i].Init(gageAds[i]);
            }

            FlyAds = flyads;
            GageAds = gageAds;

        }
    }
}