public PathNode Clone() { var node = new PathNode { Position = Position.Clone(), ID = ID, Name = Name, Parent = Parent }; node.Properties.AddRange(Properties.Select(x => x.Clone())); return node; }
private static void WritePathNode(BinaryWriter bw, PathNode node) { bw.WriteCoordinate(node.Position); bw.Write(node.ID); bw.WriteFixedLengthString(Encoding.UTF8, 128, node.Name); bw.Write(node.Properties.Count); foreach (var property in node.Properties) { WriteProperty(bw, property); } }
private static PathNode ReadPathNode(BinaryReader br) { var node = new PathNode { Position = br.ReadCoordinate(), ID = br.ReadInt32(), Name = br.ReadFixedLengthString(Encoding.UTF8, 128) }; var numProps = br.ReadInt32(); for (var i = 0; i < numProps; i++) { node.Properties.Add(ReadProperty(br)); } return node; }