public override void Render(SpriteBatch spriteBatch, Vector2i position, ReactorLayer layer, Color color, float zOrder, ImageSize imageSize, bool forDragAndDrop) { base.Render(spriteBatch, position, layer, GetFeatureColor() * color, zOrder, imageSize, forDragAndDrop); List <QuantumTunnelFeature> allTunnels; List <Vector2i> tunnelPositions; CollectTunnels(ownerReactor, out allTunnels, out tunnelPositions); int tunnelIndex = allTunnels.IndexOf(this); RenderPriority(spriteBatch, position, color, zOrder, tunnelIndex + 1); if (!laserState.isPresent && !sensorCircleState.isPresent) { return; } if (sensorCircleState.isPresent) { TextureElement sensorCircle = isSensorActivatedForRed ? redSensorCircle : blueSensorCircle; float fineCircleState = sensorCircleState.GetValue() + SimulationGlobals.partialCycle / ANIMATION_LENGTH; Color circleColor = Color.WHITE.WithAlpha(0.75f - fineCircleState); Vector2i circleSize = (Vector2i)(sensorCircle.GetDimensions() * (float)(1.0 + 1.0 * (double)fineCircleState)); spriteBatch.AddSprite(sensorCircle, new BoundingBox(boundingBox.GetCenter() + new Vector2i(-1, 0), circleSize), new BoundingBox?(), circleColor, (AngleInRadians)0.0f, circleSize / 2, FlipOptions.None, zOrder - 0.02f); } allTunnels.Add(allTunnels[0]); tunnelPositions.Add(tunnelPositions[0]); if (laserState.isPresent) { TextureElement laserBeam = isActivatedForRed ? redLaser : blueLaser; float fineLaserState = laserState.GetValue() + SimulationGlobals.partialCycle / ANIMATION_LENGTH; Vector2i startTunnelCenter = allTunnels[tunnelIndex].boundingBox.GetCenter(); Vector2i endTunnelCenter = allTunnels[tunnelIndex + 1].boundingBox.GetCenter(); Vector2f beamVector = endTunnelCenter - startTunnelCenter; Vector2f beamDirectionVector = beamVector / beamVector.Length(); Vector2i beamStart = startTunnelCenter + (Vector2i)(beamDirectionVector * 29f); Vector2i beamEnd = endTunnelCenter + (Vector2i)(beamDirectionVector * -29f); SpriteHelper.AddTextureStretchedBetween(spriteBatch, laserBeam, beamStart, beamEnd, Color.WHITE.WithAlpha((float)((1.0 - (double)fineLaserState) / 2.0)), zOrder - 0.02f); } }
public ProductionTerrain(TextureElement texture, DraggableContainer container, int verticalOffset, HashSet <Vector2i> occupiedSquares, bool gridLinesLessVisible) { }
public static AbstractRenderable MakeTexturedRectangle(TextureElement textureElement) => null;
public static void AddTextureStretchedBetween(SpriteBatch spriteBatch, TextureElement texture, Vector2i start, Vector2i end, Color color, float zOrder) { }
public void AddSprite(TextureElement textureElement, BoundingBox boundingBox, BoundingBox?textureCoords, Color color, AngleInRadians rotationAngle, Vector2i translationVector, FlipOptions flipOptions, float zOrder) { }