public Notes_DataContainer(Notes_DataContainer copy, Notes_Archive_Container n)
 {
     returnedData = copy.returnedData;
     archive_Root = n;
     vessel = null;
     archived = true;
 }
 public Notes_DataContainer(Notes_DataContainer copy, Notes_Container n)
 {
     allData = copy.allData;
     returnedData = copy.returnedData;
     root = n;
     vessel = n.NotesVessel;
 }
 public Notes_Archive_Container(Guid gid, string name, double time, double m, VesselType t)
 {
     id = gid;
     vesselName = name;
     recoveryTime = time;
     met = m;
     vtype = t;
     container = this;
     log = new Notes_VesselLog(container);
     notes = new Notes_TextContainer(container);
     checkList = new Notes_CheckListContainer(container);
     contracts = new Notes_ContractContainer(container);
     data = new Notes_DataContainer(container);
     crew = new Notes_Archived_Crew_Container(container);
 }
        private void saveData(ConfigNode node, Notes_DataContainer d)
        {
            ConfigNode data = new ConfigNode("VESSEL_SCIENCE_DATA");

            for (int j = 0; j < d.NotesDataCompletedCount; j++)
            {
                Notes_ReceivedData dat = d.getReturnedNotesData(j);

                if (d == null)
                    continue;

                ConfigNode partData = new ConfigNode("COMPLETED_DATA");
                partData.AddValue("SCIENCE_ID", dat.ID);
                partData.AddValue("SCIENCE_VALUE", dat.ScienceValue);
                partData.AddValue("TIME_RECEIVED", dat.ReceivedTime);
                data.AddNode(partData);
            }

            node.AddNode(data);
        }
        private Notes_DataContainer loadData(ConfigNode node)
        {
            Notes_DataContainer d = new Notes_DataContainer();

            for (int k = 0; k < node.GetNodes("COMPLETED_DATA").Length; k++)
            {
                ConfigNode s = node.GetNodes("COMPLETED_DATA")[k];

                if (s == null)
                    continue;

                ScienceSubject sub = s.parse("SCIENCE_ID", (ScienceSubject)null);

                if (sub == null)
                    continue;

                float value = s.parse("SCIENCE_VALUE", 0f);
                int time = s.parse("TIME_RECEIVED", (int)0);

                Notes_ReceivedData o = new Notes_ReceivedData(sub, value, time, d);

                d.addReturnedData(o);
            }

            return d;
        }
 public void loadDataNotes(Notes_DataContainer d)
 {
     data = new Notes_DataContainer(d, this);
 }
 public Notes_ReceivedData(ScienceSubject id, float value, int time, Notes_DataContainer r)
 {
     sub = id;
     scienceValue = value;
     receivedTime = time;
     date = KSPUtil.PrintDateCompact(receivedTime, false, false);
     remainingValue = Math.Min(sub.scienceCap, Math.Max(0f, sub.scienceCap * sub.scientificValue));
     text = ResearchAndDevelopment.GetResults(sub.id);
     title = sub.title;
     rootContainer = r;
 }
 public Notes_DataPart(Part p, Notes_DataContainer r)
 {
     part = p;
     id = p.flightID;
     root = r;
 }