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


C# RbSerializerN.sizeOf方法代码示例

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


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

示例1: sizeOf

            public int sizeOf(RbSerializerN serializer, Object obje)
            {
                var obj = (TeamMessage) obje;
                int s = serializer.sizeOf(obj.sender);
                int r = serializer.sizeOf(obj.recipient);
                int m = serializer.sizeOf(obj.message);

                return RbSerializerN.SIZEOF_TYPEINFO + s + r + m;
            }
开发者ID:jaros,项目名称:robocode,代码行数:9,代码来源:TeamMessage.cs

示例2: sizeOf

            public int sizeOf(RbSerializerN serializer, Object obje)
            {
                var obj = (BulletStatus) obje;

                return RbSerializerN.SIZEOF_TYPEINFO + RbSerializerN.SIZEOF_INT + serializer.sizeOf(obj.victimName)
                       + RbSerializerN.SIZEOF_BOOL + 2*RbSerializerN.SIZEOF_DOUBLE;
            }
开发者ID:EamonnACI,项目名称:ACI-SpaceRace,代码行数:7,代码来源:BulletStatus.cs

示例3: sizeOf

            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (ScannedRobotEvent) objec;

                return RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(obj.name) + 5 * RbSerializerN.SIZEOF_DOUBLE + RbSerializerN.SIZEOF_BOOL;
            }
开发者ID:markthor,项目名称:robocode,代码行数:6,代码来源:ScannedRobotEvent.cs

示例4: sizeOf

            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (RobotDeathEvent) objec;

                return RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(obj.robotName);
            }
开发者ID:hgzapata,项目名称:robocode,代码行数:6,代码来源:RobotDeathEvent.cs

示例5: sizeOf

            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (BulletHitEvent) objec;

                return RbSerializerN.SIZEOF_TYPEINFO + RbSerializerN.SIZEOF_INT + serializer.sizeOf(obj.name)
                       + RbSerializerN.SIZEOF_DOUBLE;
            }
开发者ID:markthor,项目名称:robocode,代码行数:7,代码来源:BulletHitEvent.cs

示例6: sizeOf

            public int sizeOf(RbSerializerN serializer, Object obje)
            {
                var obj = (DebugProperty) obje;

                return RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(obj.key) + serializer.sizeOf(obj.value);
            }
开发者ID:khangnguyen,项目名称:robocode,代码行数:6,代码来源:DebugProperty.cs

示例7: sizeOf

            public int sizeOf(RbSerializerN serializer, object obje)
            {
                var obj = (RobotStatics) obje;
                int size = RbSerializerN.SIZEOF_TYPEINFO
                           + serializer.sizeOf(obj.robocodeVersion)
                           + RbSerializerN.SIZEOF_BOOL * 9
                           + serializer.sizeOf(obj.name)
                           + serializer.sizeOf(obj.shortName)
                           + serializer.sizeOf(obj.veryShortName)
                           + serializer.sizeOf(obj.fullClassName)
                           + serializer.sizeOf(obj.shortClassName)
                           + RbSerializerN.SIZEOF_INT*6
                           + RbSerializerN.SIZEOF_DOUBLE
                           + RbSerializerN.SIZEOF_LONG;
                if (obj.teammates != null)
                {
                    foreach (String mate in obj.teammates)
                    {
                        size += serializer.sizeOf(mate);
                    }
                }
                size += RbSerializerN.SIZEOF_INT;
                size += serializer.sizeOf(obj.teamName);

                return size;
            }
开发者ID:Inzaghi2012,项目名称:robocode,代码行数:26,代码来源:RobotStatics.cs

示例8: sizeOf

            public int sizeOf(RbSerializerN serializer, Object obje)
            {
                var obj = (ExecCommands) obje;
                int size = RbSerializerN.SIZEOF_TYPEINFO + 4*RbSerializerN.SIZEOF_DOUBLE;

                size += 4*RbSerializerN.SIZEOF_BOOL;
                size += 5*RbSerializerN.SIZEOF_INT;
                size += 2*RbSerializerN.SIZEOF_DOUBLE;
                size += 4*RbSerializerN.SIZEOF_BOOL;
                size += serializer.sizeOf(obj.outputText);

                size += serializer.sizeOf(obj.graphicsCalls);

                // bullets
                size += obj.bullets.Count*serializer.sizeOf(RbSerializerN.BulletCommand_TYPE, null);
                size += 1;

                // messages
                foreach (TeamMessage m in obj.teamMessages)
                {
                    size += serializer.sizeOf(RbSerializerN.TeamMessage_TYPE, m);
                }
                size += 1;

                // properties
                foreach (DebugProperty d in obj.debugProperties)
                {
                    size += serializer.sizeOf(RbSerializerN.DebugProperty_TYPE, d);
                }
                size += 1;

                return size;
            }
开发者ID:EamonnACI,项目名称:ACI-SpaceRace,代码行数:33,代码来源:ExecCommands.cs

示例9: sizeOf

            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (HitByBulletEvent) objec;

                return RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(RbSerializerN.Bullet_TYPE, obj.bullet)
                       + RbSerializerN.SIZEOF_DOUBLE;
            }
开发者ID:markthor,项目名称:robocode,代码行数:7,代码来源:HitByBulletEvent.cs

示例10: sizeOf

            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (BattleEndedEvent) objec;

                return RbSerializerN.SIZEOF_TYPEINFO + RbSerializerN.SIZEOF_BOOL
                       + serializer.sizeOf(RbSerializerN.BattleResults_TYPE, obj.results);
            }
开发者ID:Chainie,项目名称:robocode,代码行数:7,代码来源:BattleEndedEvent.cs

示例11: sizeOf

            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (Bullet) objec;

                return RbSerializerN.SIZEOF_TYPEINFO + 4*RbSerializerN.SIZEOF_DOUBLE + serializer.sizeOf(obj.ownerName)
                       + serializer.sizeOf(obj.victimName) + RbSerializerN.SIZEOF_BOOL;
            }
开发者ID:vodkhang,项目名称:RoboCode-Robots,代码行数:7,代码来源:Bullet.cs

示例12: sizeOf

            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (BulletHitBulletEvent) objec;

                return RbSerializerN.SIZEOF_TYPEINFO + RbSerializerN.SIZEOF_INT
                       + serializer.sizeOf(RbSerializerN.Bullet_TYPE, obj.hitBullet);
            }
开发者ID:hgzapata,项目名称:robocode,代码行数:7,代码来源:BulletHitBulletEvent.cs

示例13: sizeOf

            public int sizeOf(RbSerializerN serializer, Object obje)
            {
                var obj = (ExecResults) obje;
                int size = RbSerializerN.SIZEOF_TYPEINFO + 3*RbSerializerN.SIZEOF_BOOL;

                size += serializer.sizeOf(RbSerializerN.ExecCommands_TYPE, obj.commands);
                size += serializer.sizeOf(RbSerializerN.RobotStatus_TYPE, obj.status);

                // events
                foreach (Event evnt in obj.events)
                {
                    size += serializer.sizeOf(evnt);
                }
                size += 1;

                // messages
                foreach (TeamMessage m in obj.teamMessages)
                {
                    size += serializer.sizeOf(RbSerializerN.TeamMessage_TYPE, m);
                }
                size += 1;

                // bullets
                foreach (BulletStatus b in obj.bulletUpdates)
                {
                    size += serializer.sizeOf(RbSerializerN.BulletStatus_TYPE, b);
                }
                size += 1;

                return size;
            }
开发者ID:vodkhang,项目名称:RoboCode-Robots,代码行数:31,代码来源:ExecResults.cs


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