public void Write(BinaryWriter sw, SolverNode n) { sw.Write(n.SolverNodeId); sw.Write(n.Parent?.SolverNodeId ?? 0); sw.Write(n.PlayerBefore.X); sw.Write(n.PlayerBefore.Y); sw.Write(n.Push.X); sw.Write(n.Push.Y); sw.Write((byte)n.Status); sw.Write(n.GetHashCode()); var c = n.CrateMap is BitmapByteSeq bs ? bs : new BitmapByteSeq(n.CrateMap); var cc = c.GetArray(); sw.Write(cc.Length); sw.Write(cc); var m = n.MoveMap is BitmapByteSeq ms ? ms : new BitmapByteSeq(n.MoveMap); var mm = m.GetArray(); sw.Write(mm.Length); sw.Write(mm); }