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(); }
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()); } } }
public NetworkGraphLink(CompWirelessDetonationGridNode first, CompWirelessDetonationGridNode second, bool canTraverse) { First = first; Second = second; CanTraverse = canTraverse; }
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); }