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


C# IValueReader.ReadInt方法代码示例

本文整理汇总了C#中IValueReader.ReadInt方法的典型用法代码示例。如果您正苦于以下问题:C# IValueReader.ReadInt方法的具体用法?C# IValueReader.ReadInt怎么用?C# IValueReader.ReadInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IValueReader的用法示例。


在下文中一共展示了IValueReader.ReadInt方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AnimatedGrhData

        /// <summary>
        /// Initializes a new instance of the <see cref="AnimatedGrhData"/> class.
        /// </summary>
        /// <param name="r">The <see cref="IValueReader"/>.</param>
        /// <param name="grhIndex">The <see cref="GrhIndex"/>.</param>
        /// <param name="cat">The <see cref="SpriteCategorization"/>.</param>
        /// <exception cref="ArgumentNullException"><paramref name="cat"/> is null.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="grhIndex"/> is equal to GrhIndex.Invalid.</exception>
        AnimatedGrhData(IValueReader r, GrhIndex grhIndex, SpriteCategorization cat) : base(grhIndex, cat)
        {
            var speed = r.ReadInt(_speedValueKey);
            var frames = r.ReadMany(_framesNodeName, (xreader, xname) => xreader.ReadGrhIndex(xname));

            _speed = 1f / speed;
            _frames = CreateFrames(frames);
            _size = GetMaxSize(_frames);
        }
开发者ID:wtfcolt,项目名称:game,代码行数:17,代码来源:AnimatedGrhData.cs

示例2: ReadCustomValues

 /// <summary>
 /// When overridden in the derived class, reads all custom state values from the <paramref name="reader"/>.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the state values from.</param>
 protected override void ReadCustomValues(IValueReader reader)
 {
     Height = reader.ReadInt(_heightKeyName);
     Width = reader.ReadInt(_widthKeyName);
     Perimeter = reader.ReadBool(_perimeterKeyName);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:10,代码来源:RectEmitter.cs

示例3: ReadCustomValues

 /// <summary>
 /// Reads the <see cref="ParticleModifier"/>'s custom values from the <see cref="reader"/>.
 /// </summary>
 /// <param name="reader"><see cref="IValueReader"/> to read the custom values from.</param>
 protected override void ReadCustomValues(IValueReader reader)
 {
     SerializedValue = reader.ReadInt("SerializedValue");
 }
开发者ID:wtfcolt,项目名称:game,代码行数:8,代码来源:ParticleModifierTests.cs

示例4: ReadCustomValues

 /// <summary>
 /// When overridden in the derived class, reads the <see cref="EmitterModifier"/>'s custom values
 /// from the <see cref="reader"/>.
 /// </summary>
 /// <param name="reader"><see cref="IValueReader"/> to read the custom values from.</param>
 protected override void ReadCustomValues(IValueReader reader)
 {
     EmitPeriod = reader.ReadInt(_emitPeriodKeyName);
     RestPeriod = reader.ReadInt(_restPeriodKeyName);
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:10,代码来源:EmitterBurstEmitModifier.cs

示例5: ReadValue

        /// <summary>
        /// Reads an audio value from an <see cref="IValueReader"/>.
        /// </summary>
        /// <param name="r">The <see cref="IValueReader"/> to read from.</param>
        /// <returns>The read audio value.</returns>
        static KeyValuePair<string, int> ReadValue(IValueReader r)
        {
            var file = r.ReadString("File");
            var index = r.ReadInt("Index");

            return new KeyValuePair<string, int>(file, index);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:12,代码来源:AudioManager.cs

示例6: Read

            /// <summary>
            /// Reads a <see cref="QuickBarSlotValues"/> from an <see cref="IValueReader"/>.
            /// </summary>
            /// <param name="r">The <see cref="IValueReader"/> to read the values from.</param>
            /// <returns>The <see cref="QuickBarSlotValues"/> read from the <paramref name="r"/>.</returns>
            public static QuickBarSlotValues Read(IValueReader r)
            {
                var slot = r.ReadByte("Slot");
                var type = r.ReadEnum<QuickBarItemType>("Type");
                var value = r.ReadInt("Value");

                return new QuickBarSlotValues(slot, type, value);
            }
开发者ID:mateuscezar,项目名称:netgore,代码行数:13,代码来源:QuickBarForm.cs

示例7: ReadState

        /// <summary>
        /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
        /// same order as they were written.
        /// </summary>
        /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
        public void ReadState(IValueReader reader)
        {
            // Read the primary values
            Name = reader.ReadString(_nameKeyName);
            BlendMode = reader.ReadEnum<BlendMode>(_blendModeKeyName);
            Budget = reader.ReadInt(_budgetKeyName);
            EmitterLife = reader.ReadInt(_emitterLifeKeyName);
            ParticleLife = reader.ReadVariableInt(_particleLifeKeyName);
            Origin = reader.ReadVector2(_originKeyName);
            ReleaseAmount = reader.ReadVariableUShort(_releaseAmountKeyName);
            ReleaseColor = reader.ReadVariableColor(_releaseColorKeyName);
            ReleaseRate = reader.ReadVariableUShort(_releaseRateKeyName);
            ReleaseRotation = reader.ReadVariableFloat(_releaseRotationKeyName);
            ReleaseScale = reader.ReadVariableFloat(_releaseScaleKeyName);
            ReleaseSpeed = reader.ReadVariableFloat(_releaseSpeedKeyName);
            Sprite.SetGrh(reader.ReadGrhIndex(_grhIndexKeyName));

            // Read the custom values
            var customValuesReader = reader.ReadNode(_customValuesNodeName);
            ReadCustomValues(customValuesReader);

            // Read the modifier collection
            ParticleModifiers.Read(_particleModifiersNodeName, reader);
            EmitterModifiers.Read(_emitterModifiersNodeName, reader);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:30,代码来源:ParticleEmitter.cs

示例8: TestXmlValueReader

 static void TestXmlValueReader(IValueReader reader)
 {
     Assert.AreEqual(10, reader.ReadInt("MyInt"));
     Assert.AreEqual(25.55f, reader.ReadFloat("MyFloat"));
     Assert.AreEqual("Hello!", reader.ReadString("MyString"));
 }
开发者ID:wtfcolt,项目名称:game,代码行数:6,代码来源:XmlReaderCreationTests.cs

示例9: ReadValue

 /// <summary>
 /// When overridden in the derived class, reads the underlying value from the <paramref name="reader"/>.
 /// </summary>
 /// <param name="reader">The IValueReader to read from.</param>
 /// <param name="valueName">The name to of the value in the <paramref name="reader"/>.</param>
 protected override void ReadValue(IValueReader reader, string valueName)
 {
     _value = reader.ReadInt(valueName);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:9,代码来源:NPCChatConditionalParameterInteger.cs

示例10: ReadState

 /// <summary>
 /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
 /// same order as they were written.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 public void ReadState(IValueReader reader)
 {
     A = reader.ReadString("A");
     B = reader.ReadInt("B");
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:10,代码来源:PersistableTests.cs

示例11: ReadCustomValues

 /// <summary>
 /// When overridden in the derived class, reads all custom state values from the <paramref name="reader"/>.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the state values from.</param>
 protected override void ReadCustomValues(IValueReader reader)
 {
     Angle = reader.ReadFloat(_angleKeyName);
     EmitBothWays = reader.ReadBool(_emitBothWaysKeyName);
     Length = reader.ReadInt(_lengthKeyName);
     Rectilinear = reader.ReadBool(_rectilinearKeyName);
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:11,代码来源:LineEmitter.cs

示例12: Read

        /// <summary>
        ///   Reads a <see cref = "KeyValuePair{T,U}" /> from an <see cref = "IValueReader" />.
        /// </summary>
        /// <param name = "r">The <see cref = "IValueReader" /> to read from.</param>
        /// <returns>The read <see cref = "KeyValuePair{T,U}" />.</returns>
        static KeyValuePair<string, HashInfo> Read(IValueReader r)
        {
            var key = r.ReadString(_textureNameValueKey);
            var hash = r.ReadString(_hashValueKey);
            var fileSize = r.ReadInt(_fileSizeValueKey);
            var lastModified = r.ReadLong(_lastModifiedValueKey);

            var hashInfo = new HashInfo(hash, fileSize, lastModified);
            return new KeyValuePair<string, HashInfo>(key, hashInfo);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:15,代码来源:TextureHashCollection.cs


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