当前位置: 首页>>代码示例>>C#>>正文


C# System.Single类代码示例

本文整理汇总了C#中System.Single的典型用法代码示例。如果您正苦于以下问题:C# Single类的具体用法?C# Single怎么用?C# Single使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Single类属于System命名空间,在下文中一共展示了Single类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BigPointsAwardedEvent

 public BigPointsAwardedEvent(Int32 score, Single x, Single y, Boolean increasesMultiplier)
 {
     this.Score = score;
     this.X = x;
     this.Y = y;
     this.IncreasesMultiplier = increasesMultiplier;
 }
开发者ID:HaKDMoDz,项目名称:Zazumo,代码行数:7,代码来源:BigPointsAwardedEvent.cs

示例2: Encode

 public static void Encode(Stream stream, Single val)
 {
     byte[] buf = BitConverter.GetBytes(val);
     if (EncodingHelpers.Endian != EndianTypes.LittleEndian)
         EncodingHelpers.ReverseBytes(buf);
     stream.Write(buf, 0, buf.Length);
 }
开发者ID:Egipto87,项目名称:DOOP.ec,代码行数:7,代码来源:SingleEncoding.cs

示例3: Play

		/// <summary>
		/// Plays a sound.
		/// </summary>
		/// <param name="id">The ChannelId identifing the SoundManger playing the sound and the channel number.</param>
		/// <param name="buffer">A SecondaryBuffer containing the sound to be playing.</param>
		/// <param name="frequencymultiplier">The multiplier applied the sound to change its pitch. 1.0f for no change.</param>
		/// <param name="looping">Whether the sound should loop automatically until stopped.</param>
		/// <param name="volume">The volume level of the sound.</param>
		public void Play(ChannelId id, SecondaryBuffer buffer, Single frequencymultiplier, Boolean looping, Int32 volume)
		{
			if (buffer == null) throw new ArgumentNullException("buffer");
			if (volume > (Int32)Volume.Max || volume < (Int32)Volume.Min) throw new ArgumentOutOfRangeException("volume");

			Stop();

			m_usingid = id;
			m_buffer = buffer;

			BufferPlayFlags flags = (looping == true) ? BufferPlayFlags.Looping : BufferPlayFlags.Default;

			m_buffer.Frequency = (Int32)(m_buffer.Frequency * frequencymultiplier);
			m_buffer.SetCurrentPosition(0);
			m_buffer.Pan = (Int32)Pan.Center;
			m_buffer.Volume = volume;

			m_playflags = flags;

			try
			{
				m_buffer.Play(0, flags);
			}
			catch { }
		}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:33,代码来源:Channel.cs

示例4: UnSerialize

        public override void UnSerialize(XElement elem)
        {
            FirstStateSlot = (Byte)(Int32)elem.Attribute("slot");

            var autoComp = elem.Element("AutoComplete");
            if (autoComp != null && !autoComp.IsEmpty)
                AutoComplete = (Int32)autoComp != 0;

            var autoCompDist = elem.Element("AutoCompleteDistance");
            if (autoCompDist != null && !autoCompDist.IsEmpty)
                AutoCompleteDistance = (Single)autoCompDist;

            var autoFail = elem.Element("AutoFail");
            if (autoFail != null && !autoFail.IsEmpty)
                AutoFail = (Int32)autoFail != 0;

            var autoFailDist = elem.Element("AutoFailDistance");
            if (autoFailDist != null && !autoFailDist.IsEmpty)
                AutoFailDistance = (Single)autoFailDist;

            var contId = elem.Element("ContinentCBID");
            if (contId != null && !contId.IsEmpty)
                ContinentId = (Int32)contId;

            var laps = elem.Element("Laps");
            if (laps != null && !laps.IsEmpty)
                Laps = (Int32)laps;

            foreach (var el in elem.Elements("GenericTargetCOID"))
                if (TargetCount < 10)
                    GenericTargets[TargetCount++] = (Int64)el;
        }
开发者ID:4ptiv4,项目名称:GenesisSharp,代码行数:32,代码来源:ObjectiveRequirementPatrol.cs

示例5: PanelDragEvent

 public PanelDragEvent(Single positionX, Single positionY, Single deltaX, Single deltaY)
 {
     this.PositionX = positionX;
     this.PositionY = positionY;
     this.DeltaX = deltaX;
     this.DeltaY = deltaY;
 }
开发者ID:HaKDMoDz,项目名称:Zazumo,代码行数:7,代码来源:PanelDragEvent.cs

示例6: NumericDialog

 public NumericDialog(Single currentValue)
     : this()
 {
     this.numericUpDown1.Maximum = decimal.MaxValue;
     this.numericUpDown1.Minimum = decimal.MinValue;
     this.numericUpDown1.Value = Convert.ToDecimal(currentValue);
 }
开发者ID:Nikey646,项目名称:FortressCraft-World-Settings-Editor,代码行数:7,代码来源:NumericDialog.cs

示例7: ColourChanger

 public ColourChanger()
 {
     _current = RandomGenerator.Default.GetRandomColour();
     _target = RandomGenerator.Default.GetRandomColour();
     _colourChangeTime = RandomGenerator.Default.GetRandomSingle(3f, 10f);
     _timer = _colourChangeTime;
 }
开发者ID:gitter-badger,项目名称:blimey,代码行数:7,代码来源:ColourChanger.cs

示例8: RectangleF

 public RectangleF(Single x, Single y, Single width, Single height)
 {
     this.X = x;
     this.Y = y;
     this.Width = width;
     this.Height = height;
 }
开发者ID:aotis,项目名称:AngryTanks,代码行数:7,代码来源:RectangleF.cs

示例9: QuaternionReading

 public QuaternionReading(Single w, Single x, Single y, Single z)
 {
     W = w;
     X = x;
     Y = y;
     Z = z;
 }
开发者ID:xesf,项目名称:Sphero-WinPhone8-SDK,代码行数:7,代码来源:QuaternionReading.cs

示例10: ShouldBe

 /// <summary>
 /// Asserts that this vector should have the specified components.
 /// </summary>
 /// <param name="x">The expected x-component.</param>
 /// <param name="y">The expected y-component.</param>
 /// <param name="z">The expected z-component.</param>
 /// <returns>The result object.</returns>
 public Vector3Result ShouldBe(Single x, Single y, Single z)
 {
     Assert.AreEqual(x, Value.X, delta);
     Assert.AreEqual(y, Value.Y, delta);
     Assert.AreEqual(z, Value.Z, delta);
     return this;
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:14,代码来源:Vector3Result.cs

示例11: Process

        protected internal override void Process(Single deltaSeconds, ref ParticleIterator iterator)
#endif
        {
            Single deltaStrength = this.Strength * deltaSeconds;

            Single deltaGravityX = this.GravityVector.X * deltaStrength;
            Single deltaGravityY = this.GravityVector.Y * deltaStrength;
            Single deltaGravityZ = this.GravityVector.Z * deltaStrength;

            var particle = iterator.First;

            do
            {
#if UNSAFE
                particle->Velocity.X += deltaGravityX;
                particle->Velocity.Y += deltaGravityY;
                particle->Velocity.Z += deltaGravityZ;
#else
                particle.Velocity.X += deltaGravityX;
                particle.Velocity.Y += deltaGravityY;
                particle.Velocity.Z += deltaGravityZ;
#endif
            }
#if UNSAFE
            while (iterator.MoveNext(&particle));
#else
            while (iterator.MoveNext(ref particle));
#endif
        }
开发者ID:rc183,项目名称:igf,代码行数:29,代码来源:LinearGravityModifier.cs

示例12: DrawVWall

 public DrawVWall(Single newPosX, Single newPosY, Single newWidth, Single newHeight)
 {
     posX = newPosX;
     posY = newPosY;
     width = newWidth;
     height = newHeight;
 }
开发者ID:jamesgabiana,项目名称:PR283-Theseus-and-the-Minotaur-C-.Net,代码行数:7,代码来源:DrawVWall.cs

示例13: DBSpecific

		internal static object DBSpecific(string key, Single single)
		{
			object retVal = null;
			DatabaseSpecific dext = new DatabaseSpecific();

			if (key == DatabaseSpecific.EXTENDED_PROPERTIES) 
			{
				if (single is IColumn) 
				{
					retVal = dext.ExtendedProperties(single as IColumn);
				}
				else if (single is ITable) 
				{
					retVal = dext.ExtendedProperties(single as ITable);
				}
				else if (single is IProcedure) 
				{
					retVal = dext.ExtendedProperties(single as IProcedure);
				}
				else if (single is IView) 
				{
					retVal = dext.ExtendedProperties(single as IView);
				}
			}
			
			return retVal;
		}
开发者ID:stacyjeptha,项目名称:EntitySpaces-CompleteSource,代码行数:27,代码来源:Database.cs

示例14: UpdateRow

        public void UpdateRow(CategoryEntity category, Single fontSize, SizeF imageViewSize)
        {
            LabelView.Text = category.Name;
            
            if (category.Picture != null && category.Picture != "BsonNull")
            {
                try
                {
                    var webClient = new WebClient();
                    webClient.DownloadDataCompleted += (s, e) =>
                    {
                        var bytes = e.Result; // get the downloaded data
                            ImageView.Image = ImageHandler.BytesToImage(bytes); // convert the data to an actual image
                    };
                    webClient.DownloadDataAsync(new Uri(category.Picture));
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Something went wrong loading image for cell..." + ex.Message);
                }
                
            }
     
            LabelView.Font = UIFont.FromName("HelveticaNeue-Bold", fontSize);

            ImageView.Frame = new RectangleF(0, 0, imageViewSize.Width, imageViewSize.Height);
            // Position category label below image
            LabelView.Frame = new RectangleF(0, (float) ImageView.Frame.Bottom+60, imageViewSize.Width, (float) (ContentView.Frame.Height - ImageView.Frame.Bottom));
        }
开发者ID:dsb92,项目名称:patientcare,代码行数:29,代码来源:CategorySource.cs

示例15: LightingManager

        static LightingManager()
        {
            ambientLightColour = Rgba32.Black;
            emissiveColour = Rgba32.DarkSlateGrey;
            specularColour = Rgba32.DarkGrey;
            specularPower = 2f;

            fogEnabled = true;
            fogStart = 100f;
            fogEnd = 1000f;
            fogColour = Rgba32.BlueViolet;

            dirLight0Direction = new Vector3(-0.3f, -0.9f, +0.3f);
            Vector3.Normalise(ref dirLight0Direction, out dirLight0Direction);
            dirLight0DiffuseColour = Rgba32.DimGrey;
            dirLight0SpecularColour = Rgba32.DarkGreen;

            dirLight1Direction = new Vector3(0.3f, 0.1f, -0.3f);
            Vector3.Normalise(ref dirLight1Direction, out dirLight1Direction);
            dirLight1DiffuseColour = Rgba32.DimGrey;
            dirLight1SpecularColour = Rgba32.DarkRed;

            dirLight2Direction = new Vector3( -0.7f, -0.3f, +0.1f);
            Vector3.Normalise(ref dirLight2Direction, out dirLight2Direction);
            dirLight2DiffuseColour = Rgba32.DimGrey;
            dirLight2SpecularColour = Rgba32.DarkBlue;
        }
开发者ID:gitter-badger,项目名称:blimey,代码行数:27,代码来源:LightingManager.cs


注:本文中的System.Single类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。