예제 #1
0
        public override void DeserializeReferences(GraphSerializationContext ctx)
        {
            int num = ctx.reader.ReadInt32();

            if (num == -1)
            {
                this.connections     = null;
                this.connectionCosts = null;
            }
            else
            {
                this.connections     = new GraphNode[num];
                this.connectionCosts = new uint[num];
                for (int i = 0; i < num; i++)
                {
                    this.connections[i]     = ctx.GetNodeFromIdentifier(ctx.reader.ReadInt32());
                    this.connectionCosts[i] = ctx.reader.ReadUInt32();
                }
            }
        }
예제 #2
0
        public override void DeserializeReferences(GraphSerializationContext ctx)
        {
            int count = ctx.reader.ReadInt32();

            if (count == -1)
            {
                connections     = null;
                connectionCosts = null;
            }
            else
            {
                connections     = new GraphNode[count];
                connectionCosts = new uint[count];

                for (int i = 0; i < count; i++)
                {
                    connections[i]     = ctx.GetNodeFromIdentifier(ctx.reader.ReadInt32());
                    connectionCosts[i] = ctx.reader.ReadUInt32();
                }
            }
        }