コード例 #1
0
 public ShapeDescriptor(STFReader stf)
 {
     Name = stf.ReadString(); // Ignore the filename string. TODO: Check if it agrees with the SD file name? Is this important?
     stf.ParseBlock(new STFReader.TokenProcessor[] {
         new STFReader.TokenProcessor("esd_detail_level", () => { EsdDetailLevel = stf.ReadIntBlock(null); }),
         new STFReader.TokenProcessor("esd_alternative_texture", () => { EsdAlternativeTexture = stf.ReadIntBlock(null); }),
         new STFReader.TokenProcessor("esd_no_visual_obstruction", () => { EsdNoVisualObstruction = stf.ReadBoolBlock(true); }),
         new STFReader.TokenProcessor("esd_snapable", () => { EsdSnapable = stf.ReadBoolBlock(true); }),
         new STFReader.TokenProcessor("esd_subobj", () => { EsdSubObject = true; stf.SkipBlock(); }),
         new STFReader.TokenProcessor("esd_bounding_box", () => {
             EsdBoundingBox = new EsdBoundingBox(stf);
             if (EsdBoundingBox.Min == null || EsdBoundingBox.Max == null)      // ie quietly handle ESD_Bounding_Box()
             {
                 EsdBoundingBox = null;
             }
         }),
         new STFReader.TokenProcessor("esd_ortssoundfilename", () => { EsdSoundFileName = stf.ReadStringBlock(null); }),
         new STFReader.TokenProcessor("esd_ortsbellanimationfps", () => { EsdBellAnimationFps = stf.ReadFloatBlock(STFReader.Units.Frequency, null); }),
     });
     // TODO - some objects have no bounding box - ie JP2BillboardTree1.sd
     //if (ESD_Bounding_Box == null) throw new STFException(stf, "Missing ESD_Bound_Box statement");
 }
コード例 #2
0
 public ShapeDescriptor()
 {
     EsdBoundingBox = new EsdBoundingBox();
 }