protected override IEnumerable <object> GenerateData(NumberColumnPOCO column, int recordsCount) { var columnMin = GetColumnMin(column); var columnMax = GetColumnMax(column); while (recordsCount-- > 0) { yield return(RANDOM.NextDouble() * (columnMax - columnMin) + columnMin); } }
protected override IEnumerable <object> GenerateData(DateTimeColumnPOCO column, int recordsCount) { var milisecondsRange = (column.MaxValue - column.MinValue).TotalMilliseconds; while (recordsCount-- > 0) { var miliseconds = RANDOM.NextDouble() * milisecondsRange; yield return(column.MinValue.AddMilliseconds(miliseconds)); } }
public override void Update(object gameTime) { if (GlobalPosition.Y + Origin.Y * 10 < 0 && GlobalPosition.X + Origin.X * 10 > SCREEN_SIZE.X) { opacity = (float)RANDOM.NextDouble() * 0.3f; position = new Vector2(-Origin.X * 10, SCREEN_SIZE.Y + Origin.Y * 10); } else { position += velocity; } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testUpper() public virtual void testUpper() { for (int i = 0; i < 10; i++) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final double x = A + 5 * Math.log(RANDOM.nextDouble()); double x = A + 5 * Math.Log(RANDOM.NextDouble()); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final double y = 5 * NORMAL.nextRandom(); double y = 5 * NORMAL.nextRandom(); assertRoundTrip(UPPER_LIMIT, x); assertReverseRoundTrip(UPPER_LIMIT, y); assertGradient(UPPER_LIMIT, x); assertInverseGradient(UPPER_LIMIT, y); assertGradientRoundTrip(UPPER_LIMIT, x); } }
public Clouds(Vector2 position) { velocity = new Vector2(1, -0.3f); rotation = RANDOM.Next(1, 20); this.position = position; opacity = (float)RANDOM.NextDouble() * 0.3f; if (RANDOM.NextDouble() > 0.5) { currentTexture = Sprites.SPR_CLOUD1; } else { currentTexture = Sprites.SPR_CLOUD2; } }
public override void Update(object gameTime) { base.Update(gameTime); handler.Update(gameTime); if (!scoreAdded) { Add(scoreForm); scoreAdded = true; } if (backButton.Pressed) { GameEnvironment.GameStateManager.SwitchTo("MainMenuState"); } if (RANDOM.NextDouble() > 0.97) { pc.AddExplosion(new Vector2(RANDOM.Next(0, 1920), RANDOM.Next(0, 1080))); PlaySound(ContentImporter.Sounds.SND_EXPLOSION); } }
public static void AddNoise(SpriteBatch spriteBatch, int noiseAmount) { for (int a = 0; a <= noiseAmount; a++) { for (int i = 0; i <= SCREEN_SIZE.X; i++) { spriteBatch.Draw(Sprites.SPR_WHITEPIXEL, new Vector2(i + RANDOM.Next(-5, 5), RANDOM.Next(SCREEN_SIZE.Y)), null, null, null, (float)RANDOM.NextDouble() * 2f, null, Color.Gray); } } }