// Function from file: sun.dm public override void fire( ) { double s = 0; double c = 0; Obj_Machinery_Power_SolarControl SC = null; this.angle = (this.angle + this.rate * 6 + 360) % 360; s = Math.Sin(this.angle); c = Math.Cos(this.angle); if (Math.Abs(s) < Math.Abs(c)) { this.dx = s / Math.Abs(c); this.dy = c / Math.Abs(c); } else { this.dx = s / Math.Abs(s); this.dy = c / Math.Abs(s); } foreach (dynamic _a in Lang13.Enumerate(this.solars, typeof(Obj_Machinery_Power_SolarControl))) { SC = _a; if (!Lang13.Bool(SC.powernet)) { this.solars.Remove(SC); continue; } SC.update(); } return; }
// Function from file: tracker.dm public void unset_control( ) { if (this.control != null) { this.control.connected_tracker = null; } this.control = null; return; }
// Function from file: solar.dm public void unset_control( ) { if (this.control != null) { this.control.connected_panels.Remove(this); } this.control = null; return; }
// Function from file: tracker.dm public bool set_control(Obj_Machinery_Power_SolarControl SC = null) { if (!(SC != null) || Map13.GetDistance(this, SC) > 40) { return(false); } this.control = SC; SC.connected_tracker = this; return(true); }