Hi,
I have created a class that supports IEnumerable. This class just defines a
3D box in a voxel space. I am using IEnumerable so that I can use the
"foreach()" construct to iterate through all the voxels in this space.
Unfortunately, it seems that I can no longer save this simple 3D box class
to disk since XML, when it seems the IEnumerable interface, attempts to save
all the individual coordinates of the voxels.
For example I have basically the following class:
class BoundBox3 : IEnumerable {
public Vector3 Minimum;
public Vector3 Maximum;
IEnumerable.GetEnumerator() {
return ...;
}
}
I use it all the time to do things like:
BoundBox3 myRegion = ...;
foreach( Vector3 voxel in myRegion ) {
}
And as I specified above since the XML serializer is so smart and I can not
find the appropriate XML attribute to override this behavior I am sort of
suck. I guess I can add a separate class which contains the IEnumerable and
takes a BoundBox3 but this isn't that convenient.
Any help is appreciated,
-ben houston
http://www.exocortex.org/ben