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


C# IValueReader类代码示例

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


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

示例1: ReadPayload

        public override void ReadPayload(IValueReader reader)
        {
            this.NetworkID = reader.ReadUInt32();
            this.CharacterName = reader.ReadString();

            this.Action = (PlayerUpdateAction)reader.ReadByte();
        }
开发者ID:heyitsanewb,项目名称:PokeWorld-Online,代码行数:7,代码来源:PlayerUpdateMessage.cs

示例2: SkeletonFrame

        /// <summary>
        /// Initializes a new instance of the <see cref="SkeletonFrame"/> class.
        /// </summary>
        /// <param name="reader">The <see cref="IValueReader"/> to read from.</param>
        /// <param name="contentPath">The <see cref="ContentPaths"/> to use to load from.</param>
        /// <exception cref="InvalidOperationException">The <see cref="Skeleton"/> failed to load.</exception>
        public SkeletonFrame(IValueReader reader, ContentPaths contentPath)
        {
            Read(reader, contentPath);

            if (Skeleton == null)
                throw new InvalidOperationException("Skeleton failed to load.");
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:13,代码来源:SkeletonFrame.cs

示例3: StartTracking

        public virtual InternalEntityEntry StartTracking(IEntityType entityType, object entity, IValueReader valueReader)
        {
            // TODO: Perf: Pre-compute this for speed
            var keyProperties = entityType.GetPrimaryKey().Properties;
            var keyValue = _keyFactorySource.GetKeyFactory(keyProperties).Create(entityType, keyProperties, valueReader);

            if (keyValue == EntityKey.InvalidEntityKey)
            {
                throw new InvalidOperationException(Strings.InvalidPrimaryKey(entityType.DisplayName()));
            }

            var existingEntry = TryGetEntry(keyValue);

            if (existingEntry != null)
            {
                if (existingEntry.Entity != entity)
                {
                    throw new InvalidOperationException(Strings.IdentityConflict(entityType.DisplayName()));
                }

                return existingEntry;
            }

            var newEntry = _subscriber.SnapshotAndSubscribe(_factory.Create(this, entityType, entity, valueReader));

            _identityMap.Add(keyValue, newEntry);
            _entityReferenceMap[entity] = newEntry;

            newEntry.SetEntityState(EntityState.Unchanged);

            return newEntry;
        }
开发者ID:thegido,项目名称:EntityFramework,代码行数:32,代码来源:StateManager.cs

示例4: ServerInfo

        internal ServerInfo(ISerializationContext context, IValueReader reader)
        {
            if (reader == null)
                throw new ArgumentNullException ("reader");

            Deserialize (context, reader);
        }
开发者ID:ermau,项目名称:Gablarski,代码行数:7,代码来源:ServerInfo.cs

示例5: ChannelChangeInfo

        public ChannelChangeInfo(ISerializationContext context, IValueReader reader)
        {
            if (reader == null)
                throw new ArgumentNullException("reader");

            Deserialize (context, reader);
        }
开发者ID:ermau,项目名称:Gablarski,代码行数:7,代码来源:ChannelChangeInfo.cs

示例6: ReadNextEvent

        private IEventCommand ReadNextEvent(IValueReader reader, ScriptCommandType commandType)
        {
            IEventCommand command = null;

            switch(commandType)
            {
                case ScriptCommandType.Jump:
                    command = new JumpCommand ();
                    break;
                case ScriptCommandType.Lock:
                    command = new LockCommand ();
                    break;
                case ScriptCommandType.Pause:
                    command = new PauseCommand ();
                    break;
                case ScriptCommandType.PauseEvent:
                    command = new PauseEventCommand ();
                    break;
                case ScriptCommandType.ApplyMovement:
                    command = new ApplyMovementCommand ();
                    break;
                case ScriptCommandType.Release:
                    command = new ReleaseCommand ();
                    break;
                default:
                    break;
            }

            if(command == null)
                throw new ArgumentOutOfRangeException ("commandType", "The specified event was not found.");

            command.Deserialize (reader);
            return command;
        }
开发者ID:heyitsanewb,项目名称:PokeWorld-Online,代码行数:34,代码来源:ServerEventMessage.cs

示例7: Create

        public override EntityKey Create(
            IEntityType entityType, IReadOnlyList<IProperty> properties, IValueReader valueReader)
        {
            var components = new object[properties.Count];

            for (var i = 0; i < properties.Count; i++)
            {
                var index = properties[i].Index;

                if (valueReader.IsNull(index))
                {
                    return EntityKey.InvalidEntityKey;
                }

                var value = _boxedValueReaders[i].ReadValue(valueReader, index);

                if (Equals(value, _sentinels[i]))
                {
                    return EntityKey.InvalidEntityKey;
                }

                components[i] = value;
            }

            return new CompositeEntityKey(entityType, components);
        }
开发者ID:thegido,项目名称:EntityFramework,代码行数:26,代码来源:CompositeEntityKeyFactory.cs

示例8: ReadEntity

        private NetworkEntity ReadEntity(ISerializationContext context, IValueReader reader)
        {
            var entity = new NetworkEntity (reader.ReadString (), EntityType.Client);

            entity.NetworkID = reader.ReadUInt16 ();
            UInt16 fieldCount = reader.ReadUInt16 ();

            for (int f = 0; f < fieldCount; f++)
            {
                string name = reader.ReadString ();
                ushort typeID = reader.ReadUInt16 ();

                Type type;
                context.TypeMap.TryGetType (typeID, out type);

                object value;

                if (type == typeof (Vector2))
                    value = reader.Read (context, Vector2Serializer.Instance);
                else if (type == typeof (Vector3))
                    value = reader.Read (context, Vector3Serializer.Instance);
                else
                    value = reader.Read (context, type);

                entity.Fields.Add (name, new PropertyGroup (value, type));
            }

            return entity;
        }
开发者ID:NullSoldier,项目名称:Cinco,代码行数:29,代码来源:EntitySnapshotMessage.cs

示例9: ReadPayload

        public override void ReadPayload(ISerializationContext context, IValueReader reader)
        {
            AudioSource[] sourceInfos = new AudioSource[reader.ReadInt32()];
            for (int i = 0; i < sourceInfos.Length; ++i)
                sourceInfos[i] = new AudioSource (context, reader);

            this.Sources = sourceInfos;
        }
开发者ID:ermau,项目名称:Gablarski,代码行数:8,代码来源:SourceListMessage.cs

示例10: ReadPayload

        public override void ReadPayload(ISerializationContext context, IValueReader reader)
        {
            int[] sourceIds = new int[reader.ReadInt32()];
            for (int i = 0; i < sourceIds.Length; ++i)
                sourceIds[i] = reader.ReadInt32();

            this.SourceIds = sourceIds;
        }
开发者ID:ermau,项目名称:Gablarski,代码行数:8,代码来源:SourcesRemovedMessage.cs

示例11: ReadPayload

 public override void ReadPayload(IValueReader reader)
 {
     base.ReadPayload(reader);
     var internalEndPointAddress = new IPAddress(reader.ReadBytes());
     InternalOwnEndPoint = new IPEndPoint(internalEndPointAddress, reader.ReadInt32());
     var externalEndPointAddress = new IPAddress(reader.ReadBytes());
     ExternalPeerEndPoint = new IPEndPoint(externalEndPointAddress, reader.ReadInt32());
 }
开发者ID:dishiyicijinqiu,项目名称:tcp-holepunching,代码行数:8,代码来源:RequestIntroducerIntroductionMessage.cs

示例12: ReadPayload

		public override void ReadPayload (ISerializationContext context, IValueReader reader)
		{
			if (reader.ReadBool())
				SenderId = reader.ReadString();

			GroupId = reader.ReadInt32();
			Text = reader.ReadString();
		}
开发者ID:ermau,项目名称:Tempest.Social,代码行数:8,代码来源:TextMessage.cs

示例13: Read

 public void Read(IValueReader reader)
 {
     GrhIndex = reader.ReadGrhIndex(_grhIndexValueKey);
     _sourceName = reader.ReadString(_sourceValueKey);
     _destName = reader.ReadString(_destValueKey);
     Offset = reader.ReadVector2(_offsetValueKey);
     Origin = reader.ReadVector2(_originValueKey);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:8,代码来源:SkeletonBodyItemInfo.cs

示例14: ReadFilter

        /// <summary>
        /// Reads a filter from an <see cref="IValueReader"/>.
        /// </summary>
        /// <param name="reader">The <see cref="IValueReader"/> to read from.</param>
        /// <returns>The name of the filter and the filter object.</returns>
        static KeyValuePair<string, MapDrawFilterHelper> ReadFilter(IValueReader reader)
        {
            var key = reader.ReadString(_filterKeyValueName);

            var valueReader = reader.ReadNode(_filterValueValueName);
            var value = new MapDrawFilterHelper(valueReader);

            return new KeyValuePair<string, MapDrawFilterHelper>(key, value);
        }
开发者ID:Vizzini,项目名称:netgore,代码行数:14,代码来源:MapDrawFilterHelperCollection.cs

示例15: Deserialize

        public void Deserialize(IValueReader reader)
        {
            this.NonCharacter = reader.ReadBool();
            this.PlayerID = reader.ReadInt32 ();

            int count = reader.ReadInt32 ();
            for(int i = 0; i < count; i++)
                this.path.Add ((Directions) reader.ReadInt32 ());
        }
开发者ID:heyitsanewb,项目名称:PokeWorld-Online,代码行数:9,代码来源:ApplyMovementCommand.cs


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