• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# FlatBuffers.ByteBuffer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: LocalPerformanceTest

        static void LocalPerformanceTest()
        {
            byte[] data = System.IO.File.ReadAllBytes ("/Users/mzaks/Downloads/flatbuffers-master/samples/doge/gen/player_state.mon");
            int length1 = data.Length, length2 = 0;
            var byteBuffer = new FlatBuffers.ByteBuffer (data);
            var gamestate = GameStateRoot.GetRootAsGameStateRoot (byteBuffer);
            Stopwatch watch = new Stopwatch ();
            int numberOfRuns = 100;
            double[] m = new double[numberOfRuns];
            for (int i = 0; i < numberOfRuns; i++) {
                watch.Start ();
                FBDeserializationService.singleton.Deserialize (gamestate);
                createSomeGroups ();

                FBSerialisationService.singleton.corePool = FBDeserializationService.singleton.corePool;
                FBSerialisationService.singleton.metaPool = FBDeserializationService.singleton.metaPool;

                data = FBSerialisationService.singleton.GenerateGameState ();
                length2 = data.Length;
                byteBuffer = new FlatBuffers.ByteBuffer (data);
                gamestate = GameStateRoot.GetRootAsGameStateRoot (byteBuffer);
                watch.Stop ();
                m [i] = watch.Elapsed.TotalMilliseconds;
            }
            Console.WriteLine ("Hello World! " + gamestate.GameData1.PlayerName);
            for (int i = 0; i < numberOfRuns; i++) {
                Console.WriteLine ("Elapsed " + ((i == 0) ? m [i] : m [i] - m [i - 1]));
            }
            Console.WriteLine ("Elapsed AVG " + ((m [numberOfRuns - 1] - m [0]) / (numberOfRuns - 1)));
            Console.WriteLine ("Number of core pool entities " + FBDeserializationService.singleton.corePool.Count);
            Console.WriteLine ("Number of meta pool entities " + FBDeserializationService.singleton.metaPool.Count);
            Console.WriteLine ("Length before: " + length1 + " after: " + length2);
            System.IO.File.WriteAllBytes (@"/Users/mzaks/Downloads/flatbuffers-master/samples/doge/gen/player_state2.mon", data);
        }
开发者ID:Reimerei,项目名称:port_experiments,代码行数:34,代码来源:Program.cs


示例2: runTest

 static byte[] runTest(byte[] data)
 {
     var byteBuffer = new FlatBuffers.ByteBuffer (data);
     var gamestate = GameStateRoot.GetRootAsGameStateRoot (byteBuffer);
     FBDeserializationService.singleton.Deserialize (gamestate);
     createSomeGroups ();
     //
     FBSerialisationService.singleton.corePool = FBDeserializationService.singleton.corePool;
     FBSerialisationService.singleton.metaPool = FBDeserializationService.singleton.metaPool;
     //
     FBSerialisationService.singleton.GenerateGameState ();
     //
     return data;
 }
开发者ID:Reimerei,项目名称:port_experiments,代码行数:14,代码来源:Program.cs


示例3: __init

 public GameData __init(int _i, ByteBuffer _bb)
 {
     bb_pos = _i; bb = _bb; return this;
 }
开发者ID:Reimerei,项目名称:port_experiments,代码行数:4,代码来源:GameData.cs


示例4: GetRootAsGameData

 public static GameData GetRootAsGameData(ByteBuffer _bb)
 {
     return GetRootAsGameData(_bb, new GameData());
 }
开发者ID:Reimerei,项目名称:port_experiments,代码行数:4,代码来源:GameData.cs


示例5: GetRootAsuvSwapItemMesh

 public static uvSwapItemMesh GetRootAsuvSwapItemMesh(ByteBuffer _bb, uvSwapItemMesh obj)
 {
     return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb));
 }
开发者ID:kestrelm,项目名称:CreatureTools,代码行数:4,代码来源:uvSwapItemMesh.cs


示例6: __init

 public animation __init(int _i, ByteBuffer _bb)
 {
     bb_pos = _i; bb = _bb; return this;
 }
开发者ID:kestrelm,项目名称:CreatureTools,代码行数:4,代码来源:animation.cs


示例7: GetRootAsanimation

 public static animation GetRootAsanimation(ByteBuffer _bb)
 {
     return GetRootAsanimation(_bb, new animation());
 }
开发者ID:kestrelm,项目名称:CreatureTools,代码行数:4,代码来源:animation.cs


示例8: GetRootAsListModulesResponse

 public static ListModulesResponse GetRootAsListModulesResponse(ByteBuffer _bb, ListModulesResponse obj)
 {
     return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb));
 }
开发者ID:SaviorXTanren,项目名称:xenia,代码行数:4,代码来源:ListModulesResponse.cs


示例9: GetRootAsTypeAmount

 public static TypeAmount GetRootAsTypeAmount(ByteBuffer _bb)
 {
     return GetRootAsTypeAmount(_bb, new TypeAmount());
 }
开发者ID:Reimerei,项目名称:port_experiments,代码行数:4,代码来源:TypeAmount.cs


示例10: __init

 public animationMeshTimeSample __init(int _i, ByteBuffer _bb)
 {
     bb_pos = _i; bb = _bb; return this;
 }
开发者ID:kestrelm,项目名称:CreatureTools,代码行数:4,代码来源:animationMeshTimeSample.cs


示例11: GetRootAsanimationMeshTimeSample

 public static animationMeshTimeSample GetRootAsanimationMeshTimeSample(ByteBuffer _bb, animationMeshTimeSample obj)
 {
     return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb));
 }
开发者ID:kestrelm,项目名称:CreatureTools,代码行数:4,代码来源:animationMeshTimeSample.cs


示例12: GetRootAsActorData

 public static ActorData GetRootAsActorData(ByteBuffer _bb)
 {
     return GetRootAsActorData(_bb, new ActorData());
 }
开发者ID:wuyuntao,项目名称:Synchronica,代码行数:4,代码来源:ActorData.cs


示例13: __init

 public BreakpointEvent __init(int _i, ByteBuffer _bb)
 {
     bb_pos = _i; bb = _bb; return this;
 }
开发者ID:SaviorXTanren,项目名称:xenia,代码行数:4,代码来源:BreakpointEvent.cs


示例14: GetRootAsBreakpointEvent

 public static BreakpointEvent GetRootAsBreakpointEvent(ByteBuffer _bb, BreakpointEvent obj)
 {
     return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb));
 }
开发者ID:SaviorXTanren,项目名称:xenia,代码行数:4,代码来源:BreakpointEvent.cs


示例15: __init

 public ListBreakpointsRequest __init(int _i, ByteBuffer _bb)
 {
     bb_pos = _i; bb = _bb; return this;
 }
开发者ID:SaviorXTanren,项目名称:xenia,代码行数:4,代码来源:ListBreakpointsRequest.cs


示例16: __init

 public ListModulesResponse __init(int _i, ByteBuffer _bb)
 {
     bb_pos = _i; bb = _bb; return this;
 }
开发者ID:SaviorXTanren,项目名称:xenia,代码行数:4,代码来源:ListModulesResponse.cs


示例17: __init

 public TypeAmount __init(int _i, ByteBuffer _bb)
 {
     bb_pos = _i; bb = _bb; return this;
 }
开发者ID:Reimerei,项目名称:port_experiments,代码行数:4,代码来源:TypeAmount.cs


示例18: GetRootAsPulseKeyFrameData_Float

 public static PulseKeyFrameData_Float GetRootAsPulseKeyFrameData_Float(ByteBuffer _bb)
 {
     return GetRootAsPulseKeyFrameData_Float(_bb, new PulseKeyFrameData_Float());
 }
开发者ID:wuyuntao,项目名称:Synchronica,代码行数:4,代码来源:PulseKeyFrameData_Float.cs


示例19: __init

 public uvSwapItemMesh __init(int _i, ByteBuffer _bb)
 {
     bb_pos = _i; bb = _bb; return this;
 }
开发者ID:kestrelm,项目名称:CreatureTools,代码行数:4,代码来源:uvSwapItemMesh.cs


示例20: __init

 public PulseKeyFrameData_Float __init(int _i, ByteBuffer _bb)
 {
     bb_pos = _i; bb = _bb; return this;
 }
开发者ID:wuyuntao,项目名称:Synchronica,代码行数:4,代码来源:PulseKeyFrameData_Float.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FlatBuffers.FlatBufferBuilder类代码示例发布时间:2022-05-24
下一篇:
C# Swf.Action类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap