コード例 #1
0
 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();
 }
コード例 #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());
         }
     }
 }
コード例 #3
0
 public NetworkGraphLink(CompWirelessDetonationGridNode first, CompWirelessDetonationGridNode second, bool canTraverse)
 {
     First       = first;
     Second      = second;
     CanTraverse = canTraverse;
 }
コード例 #4
0
 public TransmitterReceiverPair(CompWirelessDetonationGridNode transmitter, IWirelessDetonationReceiver receiver)
 {
     Transmitter = transmitter;
     Receiver    = receiver;
 }
コード例 #5
0
 private void GetCompRefs()
 {
     channelsUpgrade = this.TryGetUpgrade(ChannelsUpgradeId);
     node            = this.RequireComp <CompWirelessDetonationGridNode>();
     channelsComp    = GetComp <CompChannelSelector>()?.Configure(false, false, false, RemoteTechUtility.ChannelType.Basic);
 }