SerializableArray.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.CompilerServices;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace BansheeEditor
  8. {
  9. public sealed class SerializableArray
  10. {
  11. public SerializableArray(object obj)
  12. {
  13. // TODO - Initialize the array - handle it properly in case obj isn't a valid array
  14. }
  15. public SerializableField.FieldType ElementType;
  16. private int[] dimensions;
  17. private int rank;
  18. public int GetDimension(int rank)
  19. {
  20. return dimensions[rank];
  21. }
  22. public int Rank
  23. {
  24. get { return rank; }
  25. }
  26. public SerializableValue GetValue(int id)
  27. {
  28. return null; // TODO - Return actual SerializableValue
  29. }
  30. // TODO - Add getters/setters for all fields
  31. [MethodImpl(MethodImplOptions.InternalCall)]
  32. private static extern void Internal_SetInt32(IntPtr nativeInstance, int arrayIdx, Int32 value);
  33. [MethodImpl(MethodImplOptions.InternalCall)]
  34. private static extern Int32 Internal_GetInt32(IntPtr nativeInstance, int arrayIdx);
  35. }
  36. }