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


C# Shared.ReadByte方法代码示例

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


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

示例1: CreateEvent

        /// <summary>
        /// This should read in a Type byte and create an instance of the correct type
        /// Each event type should include a custom 'Execute' method that handles it
        /// </summary>
        protected override IEvent CreateEvent(Shared.InamStream stream)
        {
            int ID = stream.ReadInt32();
            BrainEventType type = (BrainEventType)stream.ReadByte();

            if (type == BrainEventType.System)
            {
            }
            else if (type == BrainEventType.Sight)
            {
                return new BrainSightEvent(this, stream, this.entity);
            }
            else if (type == BrainEventType.Touch)
            {
                return new BrainTouchEvent(this, stream, this.entity);
            }
            else if (type == BrainEventType.Hear)
            {

            }
            else if (type == BrainEventType.Taste)
            {

            }

            // bad
            return null;
        }
开发者ID:milesgray,项目名称:resatiate,代码行数:32,代码来源:BrainEventManager.cs

示例2: CreateEvent

        protected override IEvent CreateEvent(Shared.InamStream stream)
        {
            //int ID = stream.ReadInt32();  // there is no ID here, as we are just choosing the correct sense to send this to
            byte type = stream.ReadByte();

            // bad
            return null;
        }
开发者ID:milesgray,项目名称:resatiate,代码行数:8,代码来源:EntityEventManager.cs

示例3: CreateEvent

        protected override IEvent CreateEvent(Shared.InamStream stream)
        {
            int ID = stream.ReadInt32();
            TileEngineEventTypes type = (TileEngineEventTypes)stream.ReadByte();

            if (type == TileEngineEventTypes.Tile)
            {
                return new TileEvent(this, stream);
            }

            // bad
            return null;
        }
开发者ID:milesgray,项目名称:resatiate,代码行数:13,代码来源:TileEngineEventManager.cs

示例4: CreateEvent

        protected override IEvent CreateEvent(Shared.InamStream stream)
        {
            int ID = stream.ReadInt32();
            TileEventType type = (TileEventType)stream.ReadByte();

            if (type == TileEventType.Entity)
            {
                return null;
            }
            else if (type == TileEventType.AddEntity)
            {
            }
            else if (type == TileEventType.RemoveEntity)
            {
            }

            // bad
            return null;
        }
开发者ID:milesgray,项目名称:resatiate,代码行数:19,代码来源:TileEventManager.cs


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