public override void SpawnSetup(Map map, bool respawningAfterLoad)
 {
     base.SpawnSetup(map, respawningAfterLoad);
     angleStat    = this.GetCachedStat(Resources.Stat.rxSensorAngle);
     speedStat    = this.GetCachedStat(Resources.Stat.rxSensorSpeed);
     rangeStat    = this.GetCachedStat(Resources.Stat.rxSensorRange);
     powerComp    = GetComp <CompPowerTrader>();
     wiredComp    = GetComp <CompWiredDetonationSender>();
     wirelessComp = GetComp <CompWirelessDetonationGridNode>();
     channelsComp = GetComp <CompChannelSelector>();
     brainComp    = this.TryGetUpgrade(AIUpgrageReferenceId);
     lightComp    = GetComp <CompAIPilotLight>();
     glowerComp   = GetComp <CompGlowerToggleable>();
     UpdateUpgradeableStuff();
 }
Exemplo n.º 2
0
 public override void DrawGhost(ThingDef def, IntVec3 center, Rot4 rot, Color ghostCol, Thing thing = null)
 {
     if (thing != null)
     {
         // while existing building is selected
         CompWirelessDetonationGridNode node;
         if (thing is ThingWithComps twc && (node = twc.GetComp <CompWirelessDetonationGridNode>()) != null && node.Enabled)
         {
             node.DrawNetworkLinks();
         }
     }
     else
     {
         // preparing to build
         var nodes = CompWirelessDetonationGridNode.GetPotentialNeighborsFor(def, center, Find.CurrentMap);
         foreach (var node in nodes)
         {
             GenDraw.DrawLineBetween(center.ToVector3Shifted(), node.parent.Position.ToVector3Shifted());
         }
     }
 }
Exemplo n.º 3
0
 public NetworkGraphLink(CompWirelessDetonationGridNode first, CompWirelessDetonationGridNode second, bool canTraverse)
 {
     First       = first;
     Second      = second;
     CanTraverse = canTraverse;
 }
Exemplo n.º 4
0
 public TransmitterReceiverPair(CompWirelessDetonationGridNode transmitter, IWirelessDetonationReceiver receiver)
 {
     Transmitter = transmitter;
     Receiver    = receiver;
 }
 private void GetCompRefs()
 {
     channelsUpgrade = this.TryGetUpgrade(ChannelsUpgradeId);
     node            = this.RequireComp <CompWirelessDetonationGridNode>();
     channelsComp    = GetComp <CompChannelSelector>()?.Configure(false, false, false, RemoteTechUtility.ChannelType.Basic);
 }