Esempio n. 1
0
 void ExDiscoverWorkshops(BaseEventData data)
 {
     if (!functional)
     {
         return;
     }
     // Even the master workshop is its own slave.
     //Debug.Log (String.Format ("[EL Workshop] slave"));
     master = data.Get <ExWorkshop> ("master");
     data.Get <List <ExWorkshop> > ("sources").Add(this);
 }
Esempio n. 2
0
        private void DiscoverWorkshops()
        {
            ExWorkshop shop = findFirstWorkshop(vessel.rootPart);

            if (shop == this)
            {
                //Debug.Log (String.Format ("[EL Workshop] master"));
                var data = new BaseEventData(BaseEventData.Sender.USER);
                data.Set <ExWorkshop> ("master", this);
                sources = new List <ExWorkshop> ();
                sinks   = new List <ExWorkSink> ();
                data.Set <List <ExWorkshop> > ("sources", sources);
                data.Set <List <ExWorkSink> > ("sinks", sinks);
                vessel.rootPart.SendEvent("ExDiscoverWorkshops", data);
            }
            else
            {
                sources = null;
                sinks   = null;
            }
        }
 void ExDiscoverWorkshops(BaseEventData data)
 {
     if (!functional) {
     return;
     }
     // Even the master workshop is its own slave.
     //Debug.Log (String.Format ("[EL Workshop] slave"));
     master = data.Get<ExWorkshop> ("master");
     data.Get<List<ExWorkshop>> ("sources").Add (this);
 }