System.Collections.Generic.List.Add(nfloat)

Here are the examples of the csharp api System.Collections.Generic.List.Add(nfloat) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 View Source File : Acceleration.cs
License : Apache License 2.0
Project Creator : migueldeicaza

void TrackPause (nfloat velocity, nfloat offset)
	{
		if (hasPaused)
			return;

		// update the array of most recent velocities

		if (velocities.Count >= numberOfVelocities) 
			velocities.RemoveAt (0);
		velocities.Add (velocity);
		// enforce minimum velocity and offset
		if (NMath.Abs (velocity) > 100 || Math.Abs (offset) < 50)
			return;
		var firstRecorded = velocities [0];
		// if the majority of the velocity has been lost recetly, we consider the motion to be paused

		if (NMath.Abs (firstRecorded - velocity) / NMath.Abs (firstRecorded) > 0.9) {
			pauseLabel.Alpha = 1;
			feedbackGenerator.ImpactOccurred ();
			hasPaused = true;
			velocities.Clear ();
		}
	}