public void CompileData(List <Substance> substances) { IntegerBank.Clear(); FloatBank.Clear(); CharBank.Clear(); foreach (Substance sub in substances) { sub.PrepareSubstance(substances); switch (sub) { case Substance <ObservableCollection <PrimitiveBinding <float> > > float_sub: float_sub.UpdateSubstanceDataForExport(float_sub.Data.Count, AddFloatData); break; case Substance <ObservableCollection <PrimitiveBinding <int> > > int_sub: int_sub.UpdateSubstanceDataForExport(int_sub.Data.Count, AddIntData); break; case Substance <ObservableCollection <BindingVector3> > vec_sub: vec_sub.UpdateSubstanceDataForExport(vec_sub.Data.Count, AddVec3Data); break; case Substance <PrimitiveBinding <string> > string_sub: if (!string_sub.Data.Value.EndsWith("\0")) { string_sub.Data.Value += '\0'; } string_sub.UpdateSubstanceDataForExport(string_sub.Data.Value.Length, AddStringData); break; } } }
public int AddFloatData(ObservableCollection <PrimitiveBinding <float> > float_data) { int new_offset = FloatBank.Count; for (int i = 0; i < float_data.Count; i++) { FloatBank.Add(float_data[i].Value); } return(new_offset); }
public int AddVec3Data(ObservableCollection <BindingVector3> vec3_data) { int new_offset = FloatBank.Count; foreach (BindingVector3 v in vec3_data) { FloatBank.Add(v.X); FloatBank.Add(v.Y); FloatBank.Add(v.Z); } return(new_offset); }