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


C# RbSerializerN类代码示例

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


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

示例1: 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

示例2: serialize

            public void serialize(RbSerializerN serializer, ByteBuffer buffer, Object obje)
            {
                var obj = (DebugProperty) obje;

                serializer.serialize(buffer, obj.key);
                serializer.serialize(buffer, obj.value);
            }
开发者ID:khangnguyen,项目名称:robocode,代码行数:7,代码来源:DebugProperty.cs

示例3: deserialize

            public Object deserialize(RbSerializerN serializer, ByteBuffer buffer)
            {
                String key = serializer.deserializeString(buffer);
                String value = serializer.deserializeString(buffer);

                return new DebugProperty(key, value);
            }
开发者ID:khangnguyen,项目名称:robocode,代码行数:7,代码来源:DebugProperty.cs

示例4: serialize

            public void serialize(RbSerializerN serializer, ByteBuffer buffer, Object obje)
            {
                var obj = (TeamMessage) obje;

                serializer.serialize(buffer, obj.sender);
                serializer.serialize(buffer, obj.recipient);
                serializer.serialize(buffer, obj.message);
            }
开发者ID:jaros,项目名称:robocode,代码行数:8,代码来源:TeamMessage.cs

示例5: deserialize

            public Object deserialize(RbSerializerN serializer, ByteBuffer buffer)
            {
                String sender = serializer.deserializeString(buffer);
                String recipient = serializer.deserializeString(buffer);
                byte[] message = serializer.deserializeBytes(buffer);

                return new TeamMessage(sender, recipient, message);
            }
开发者ID:jaros,项目名称:robocode,代码行数:8,代码来源:TeamMessage.cs

示例6: serialize

            public void serialize(RbSerializerN serializer, ByteBuffer buffer, Object obje)
            {
                var obj = (BulletCommand) obje;

                serializer.serialize(buffer, obj.power);
                serializer.serialize(buffer, obj.fireAssistValid);
                serializer.serialize(buffer, obj.fireAssistAngle);
                serializer.serialize(buffer, obj.bulletId);
            }
开发者ID:markthor,项目名称:robocode,代码行数:9,代码来源:BulletCommand.cs

示例7: deserialize

            public Object deserialize(RbSerializerN serializer, ByteBuffer buffer)
            {
                double power = buffer.getDouble();
                bool fireAssistValid = serializer.deserializeBoolean(buffer);
                double fireAssistAngle = buffer.getDouble();
                int bulletId = buffer.getInt();

                return new BulletCommand(power, fireAssistValid, fireAssistAngle, bulletId);
            }
开发者ID:markthor,项目名称:robocode,代码行数:9,代码来源:BulletCommand.cs

示例8: 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

示例9: serialize

 public void serialize(RbSerializerN serializer, ByteBuffer buffer, object objec)
 {
     var obj = (KeyPressedEvent) objec;
     serializer.serialize(buffer, obj.KeyChar);
     serializer.serialize(buffer, obj.KeyCode);
     serializer.serialize(buffer, obj.KeyLocation);
     serializer.serialize(buffer, obj.ID);
     serializer.serialize(buffer, obj.ModifiersEx);
     serializer.serialize(buffer, obj.When);
 }
开发者ID:EamonnACI,项目名称:ACI-SpaceRace,代码行数:10,代码来源:KeyPressedEvent.cs

示例10: deserialize

            public Object deserialize(RbSerializerN serializer, ByteBuffer buffer)
            {
                int bulletId = buffer.getInt();
                String victimName = serializer.deserializeString(buffer);
                bool isActive = serializer.deserializeBoolean(buffer);
                double x = buffer.getDouble();
                double y = buffer.getDouble();

                return new BulletStatus(bulletId, x, y, victimName, isActive);
            }
开发者ID:EamonnACI,项目名称:ACI-SpaceRace,代码行数:10,代码来源:BulletStatus.cs

示例11: serialize

            public void serialize(RbSerializerN serializer, ByteBuffer buffer, Object obje)
            {
                var obj = (BulletStatus) obje;

                serializer.serialize(buffer, obj.bulletId);
                serializer.serialize(buffer, obj.victimName);
                serializer.serialize(buffer, obj.isActive);
                serializer.serialize(buffer, obj.x);
                serializer.serialize(buffer, obj.y);
            }
开发者ID:EamonnACI,项目名称:ACI-SpaceRace,代码行数:10,代码来源:BulletStatus.cs

示例12: deserialize

 public object deserialize(RbSerializerN serializer, ByteBuffer buffer)
 {
     char keyChar = buffer.getChar();
     int keyCode = buffer.getInt();
     int keyLocation = buffer.getInt();
     int id = buffer.getInt();
     int modifiersEx = buffer.getInt();
     long when = buffer.getLong();
     return new KeyPressedEvent(keyChar, keyCode, keyLocation, id, modifiersEx, when);
 }
开发者ID:EamonnACI,项目名称:ACI-SpaceRace,代码行数:10,代码来源:KeyPressedEvent.cs

示例13: serialize

            public void serialize(RbSerializerN serializer, ByteBuffer buffer, object objec)
            {
                var obj = (MouseClickedEvent) objec;

                serializer.serialize(buffer, obj.Button);
                serializer.serialize(buffer, obj.ClickCount);
                serializer.serialize(buffer, obj.X);
                serializer.serialize(buffer, obj.Y);
                serializer.serialize(buffer, obj.ID);
                serializer.serialize(buffer, obj.ModifiersEx);
                serializer.serialize(buffer, obj.When);
            }
开发者ID:khangnguyen,项目名称:robocode,代码行数:12,代码来源:MouseClickedEvent.cs

示例14: BasicRobotProxy

        public BasicRobotProxy(IRobotItem specification, IHostManager hostManager, IRobotPeer peer, RobotStatics statics)
            : base(specification, hostManager, peer, statics)
        {
            eventManager = new EventManager(this);

            graphicsProxy = new GraphicsProxy();

            // dummy
            execResults = new ExecResults(null, null, null, null, null, false, false, false);

            setSetCallCount(0);
            setGetCallCount(0);

            var sharedBuffer = new byte[10*1024*100];
            execJavaBuffer = new DirectByteBuffer(sharedBuffer);
            execNetBuffer = ByteBuffer.wrap(sharedBuffer);
            rbSerializerN = new RbSerializerN();
            this.peer.setupBuffer(execJavaBuffer);
        }
开发者ID:Inzaghi2012,项目名称:robocode,代码行数:19,代码来源:BasicRobotProxy.cs

示例15: deserialize

            public object deserialize(RbSerializerN serializer, ByteBuffer buffer)
            {
                string name = serializer.deserializeString(buffer);
                double energy = buffer.getDouble();
                double heading = buffer.getDouble();
                double bearing = buffer.getDouble();
                double distance = buffer.getDouble();
                double velocity = buffer.getDouble();
                bool isSentryRobot = serializer.deserializeBoolean(buffer);

                return new ScannedRobotEvent(name, energy, bearing, distance, heading, velocity, isSentryRobot);
            }
开发者ID:markthor,项目名称:robocode,代码行数:12,代码来源:ScannedRobotEvent.cs


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