예제 #1
0
            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);
            }
예제 #2
0
            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);
            }
예제 #3
0
            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);
            }
예제 #4
0
            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;
            }
예제 #5
0
            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);
            }
예제 #6
0
            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);
            }
예제 #7
0
            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));
            }
예제 #8
0
            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (HitRobotEvent)objec;

                return(RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(obj.name) + 2 * RbSerializerN.SIZEOF_DOUBLE
                       + RbSerializerN.SIZEOF_BOOL);
            }
예제 #9
0
            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);
            }
예제 #10
0
            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);
            }
예제 #11
0
            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));
            }
예제 #12
0
            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 + RbSerializerN.SIZEOF_INT);
            }
예제 #13
0
            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;
            }
예제 #14
0
            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (BattleResults)objec;

                return(RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(obj.teamLeaderName) +
                       4 * RbSerializerN.SIZEOF_INT
                       + 7 * RbSerializerN.SIZEOF_DOUBLE);
            }
예제 #15
0
            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);
            }
예제 #16
0
            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;
            }
예제 #17
0
            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (RobotDeathEvent)objec;

                return(RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(obj.robotName));
            }
예제 #18
0
            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;
            }
예제 #19
0
            public int sizeOf(RbSerializerN serializer, Object obje)
            {
                var obj = (DebugProperty) obje;

                return RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(obj.key) + serializer.sizeOf(obj.value);
            }
예제 #20
0
            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);
            }
예제 #21
0
            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;
            }
예제 #22
0
            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;
            }
예제 #23
0
            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;
            }
예제 #24
0
            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (RobotDeathEvent) objec;

                return RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(obj.robotName);
            }
예제 #25
0
            public int sizeOf(RbSerializerN serializer, Object obje)
            {
                var obj = (DebugProperty) obje;

                return RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(obj.key) + serializer.sizeOf(obj.value);
            }
예제 #26
0
            public int sizeOf(RbSerializerN serializer, object objec)
            {
                var obj = (ScannedRobotEvent)objec;

                return(RbSerializerN.SIZEOF_TYPEINFO + serializer.sizeOf(obj.name) + 5 * RbSerializerN.SIZEOF_DOUBLE);
            }
예제 #27
0
            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;
            }
예제 #28
0
            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;
            }