| | 1 | | // Copyright (c) 2020-2023 dotBunny Inc. |
| | 2 | | // dotBunny licenses this file to you under the BSL-1.0 license. |
| | 3 | | // See the LICENSE file in the project root for more information. |
| | 4 | |
|
| | 5 | | using System; |
| | 6 | | using GDX.Collections; |
| | 7 | | using UnityEngine; |
| | 8 | | using Object = UnityEngine.Object; |
| | 9 | |
|
| | 10 | | namespace GDX.DataTables |
| | 11 | | { |
| | 12 | |
|
| | 13 | | [HelpURL("https://gdx.dotbunny.com/manual/features/data-tables.html")] |
| | 14 | | [CreateAssetMenu(menuName = "GDX/Stable Data Table", fileName = "GDXStableDataTable")] |
| | 15 | | [Serializable] |
| | 16 | | public class StableDataTable : DataTableBase |
| | 17 | | { |
| | 18 | | #pragma warning disable IDE1006 |
| | 19 | | // ReSharper disable InconsistentNaming |
| | 20 | |
|
| | 21 | | [SerializeField] internal ArrayHolder<string>[] m_AllStringColumns; |
| | 22 | | [SerializeField] internal ArrayHolder<bool>[] m_AllBoolColumns; |
| | 23 | | [SerializeField] internal ArrayHolder<char>[] m_AllCharColumns; |
| | 24 | | [SerializeField] internal ArrayHolder<sbyte>[] m_AllSByteColumns; |
| | 25 | | [SerializeField] internal ArrayHolder<byte>[] m_AllByteColumns; |
| | 26 | | [SerializeField] internal ArrayHolder<short>[] m_AllShortColumns; |
| | 27 | | [SerializeField] internal ArrayHolder<ushort>[] m_AllUShortColumns; |
| | 28 | | [SerializeField] internal ArrayHolder<int>[] m_AllIntColumns; |
| | 29 | | [SerializeField] internal ArrayHolder<uint>[] m_AllUIntColumns; |
| | 30 | | [SerializeField] internal ArrayHolder<long>[] m_AllLongColumns; |
| | 31 | | [SerializeField] internal ArrayHolder<ulong>[] m_AllULongColumns; |
| | 32 | | [SerializeField] internal ArrayHolder<float>[] m_AllFloatColumns; |
| | 33 | | [SerializeField] internal ArrayHolder<double>[] m_AllDoubleColumns; |
| | 34 | | [SerializeField] internal ArrayHolder<Vector2>[] m_AllVector2Columns; |
| | 35 | | [SerializeField] internal ArrayHolder<Vector3>[] m_AllVector3Columns; |
| | 36 | | [SerializeField] internal ArrayHolder<Vector4>[] m_AllVector4Columns; |
| | 37 | | [SerializeField] internal ArrayHolder<Vector2Int>[] m_AllVector2IntColumns; |
| | 38 | | [SerializeField] internal ArrayHolder<Vector3Int>[] m_AllVector3IntColumns; |
| | 39 | | [SerializeField] internal ArrayHolder<Quaternion>[] m_AllQuaternionColumns; |
| | 40 | | [SerializeField] internal ArrayHolder<Rect>[] m_AllRectColumns; |
| | 41 | | [SerializeField] internal ArrayHolder<RectInt>[] m_AllRectIntColumns; |
| | 42 | | [SerializeField] internal ArrayHolder<Color>[] m_AllColorColumns; |
| | 43 | | [SerializeField] internal ArrayHolder<LayerMask>[] m_AllLayerMaskColumns; |
| | 44 | | [SerializeField] internal ArrayHolder<Bounds>[] m_AllBoundsColumns; |
| | 45 | | [SerializeField] internal ArrayHolder<BoundsInt>[] m_AllBoundsIntColumns; |
| | 46 | | [SerializeField] internal ArrayHolder<Hash128>[] m_AllHash128Columns; |
| | 47 | | [SerializeField] internal ArrayHolder<Gradient>[] m_AllGradientColumns; |
| | 48 | | [SerializeField] internal ArrayHolder<AnimationCurve>[] m_AllAnimationCurveColumns; |
| | 49 | | [SerializeField] internal ArrayHolder<Object>[] m_AllObjectRefColumns; |
| | 50 | | [SerializeField] internal ArrayHolder<int>[] m_AllEnumIntColumns; |
| | 51 | | [SerializeField] internal string[] m_AllObjectRefTypeNames; |
| | 52 | | [SerializeField] internal string[] m_AllEnumIntTypeNames; |
| | 53 | |
|
| | 54 | | /// <summary> |
| | 55 | | /// Contains the name of each column of each type. Ordered by Serializable.SerializableTypes |
| | 56 | | /// </summary> |
| | 57 | | [SerializeField] |
| 10 | 58 | | internal ArrayHolder<string>[] m_AllColumnNames = new ArrayHolder<string>[Serializable.SerializableTypesCount]; |
| | 59 | |
|
| | 60 | | [SerializeField] internal int[] m_RowIdentifierToDenseIndexMap; |
| | 61 | | [SerializeField] internal int[] m_RowDenseIndexToIDMap; |
| | 62 | | [SerializeField] internal string[] m_RowNames; |
| | 63 | | [SerializeField] internal int m_RowEntriesFreeListHead; |
| | 64 | | [SerializeField] internal int m_RowCount; |
| | 65 | | [SerializeField] internal ColumnEntry[] m_ColumnIdentifierToDenseIndexMap; |
| | 66 | | [SerializeField] internal int[] m_ColumnIdentifierToSortOrderMap; |
| | 67 | | [SerializeField] internal int[] m_SortedOrderToColumnIdentifierMap; |
| | 68 | |
|
| 10 | 69 | | [SerializeField] internal ArrayHolder<int>[] m_ColumnDenseIndexToIDMap = |
| | 70 | | new ArrayHolder<int>[Serializable.SerializableTypesCount]; |
| | 71 | |
|
| | 72 | | [SerializeField] internal int m_ColumnEntriesFreeListHead; |
| | 73 | | [SerializeField] internal int m_CombinedColumnCount; |
| 10 | 74 | | [SerializeField] internal ulong m_DataVersion = 1; |
| | 75 | |
|
| | 76 | | // ReSharper enable InconsistentNaming |
| | 77 | | #pragma warning restore IDE1006 |
| | 78 | |
|
| | 79 | |
|
| | 80 | | /// <summary> |
| | 81 | | /// Version of internal structure format. |
| | 82 | | /// </summary> |
| | 83 | | /// <remarks>Bump this if you make a change that requires resizing of arrays.</remarks> |
| 10 | 84 | | [SerializeField] internal int m_StructureVersion = 1; |
| | 85 | |
|
| | 86 | | /// <inheritdoc /> |
| | 87 | | public override ulong GetDataVersion() |
| 0 | 88 | | { |
| 0 | 89 | | return m_DataVersion; |
| 0 | 90 | | } |
| | 91 | |
|
| | 92 | | /// <inheritdoc /> |
| | 93 | | public override int GetStructureVersion() |
| 0 | 94 | | { |
| 0 | 95 | | return m_StructureVersion; |
| 0 | 96 | | } |
| | 97 | |
|
| | 98 | | /// <inheritdoc /> |
| | 99 | | public override int GetStructureCurrentVersion() |
| 0 | 100 | | { |
| 0 | 101 | | return 1; |
| 0 | 102 | | } |
| | 103 | |
|
| | 104 | | public override bool Migrate(int currentVersion) |
| 0 | 105 | | { |
| 0 | 106 | | switch (m_StructureVersion) |
| | 107 | | { |
| | 108 | | case 0: |
| | 109 | | // Pre EnumInt |
| 0 | 110 | | if (currentVersion >= 0) |
| 0 | 111 | | { |
| 0 | 112 | | Array.Resize(ref m_AllColumnNames, 30); |
| 0 | 113 | | Array.Resize(ref m_ColumnDenseIndexToIDMap, 30); |
| 0 | 114 | | } |
| | 115 | |
|
| 0 | 116 | | m_StructureVersion = currentVersion; |
| 0 | 117 | | break; |
| | 118 | | } |
| | 119 | |
|
| 0 | 120 | | return m_StructureVersion == currentVersion; |
| 0 | 121 | | } |
| | 122 | |
|
| | 123 | | /// <inheritdoc /> |
| | 124 | | public override int GetColumnCount() |
| 52 | 125 | | { |
| 52 | 126 | | return m_CombinedColumnCount; |
| 52 | 127 | | } |
| | 128 | |
|
| | 129 | | /// <inheritdoc /> |
| | 130 | | public override int GetRowCount() |
| 36 | 131 | | { |
| 36 | 132 | | return m_RowCount; |
| 36 | 133 | | } |
| | 134 | |
|
| | 135 | | /// <inheritdoc /> |
| | 136 | | public override RowDescription[] GetAllRowDescriptions() |
| 17 | 137 | | { |
| 17 | 138 | | if (m_CombinedColumnCount == 0 || m_RowCount == 0) |
| 1 | 139 | | { |
| 1 | 140 | | return null; |
| | 141 | | } |
| | 142 | |
|
| 16 | 143 | | RowDescription[] returnArray = new RowDescription[m_RowCount]; |
| 128 | 144 | | for (int i = 0; i < m_RowCount; i++) |
| 48 | 145 | | { |
| 48 | 146 | | returnArray[i].Identifier = m_RowDenseIndexToIDMap[i]; |
| 48 | 147 | | returnArray[i].Name = m_RowNames[i]; |
| 48 | 148 | | returnArray[i].SortOrder = i; |
| 48 | 149 | | } |
| | 150 | |
|
| 16 | 151 | | return returnArray; |
| 17 | 152 | | } |
| | 153 | |
|
| | 154 | | /// <inheritdoc /> |
| | 155 | | public override RowDescription GetRowDescription(int rowIdentifier) |
| 0 | 156 | | { |
| 0 | 157 | | RowDescription returnRowDescription = new RowDescription(); |
| | 158 | |
|
| 0 | 159 | | int rowDenseIndex = m_RowIdentifierToDenseIndexMap[rowIdentifier]; |
| | 160 | |
|
| 0 | 161 | | returnRowDescription.Identifier = rowIdentifier; |
| 0 | 162 | | returnRowDescription.Name = m_RowNames[rowDenseIndex]; |
| 0 | 163 | | returnRowDescription.SortOrder = rowDenseIndex; |
| | 164 | |
|
| 0 | 165 | | return returnRowDescription; |
| 0 | 166 | | } |
| | 167 | |
|
| | 168 | | /// <inheritdoc /> |
| | 169 | | public override RowDescription GetRowDescriptionByOrder(int order) |
| 1 | 170 | | { |
| 1 | 171 | | return new RowDescription |
| | 172 | | { |
| | 173 | | Identifier = m_RowDenseIndexToIDMap[order], Name = m_RowNames[order], SortOrder = order |
| | 174 | | }; |
| 1 | 175 | | } |
| | 176 | |
|
| | 177 | | /// <inheritdoc /> |
| | 178 | | public override ColumnDescription GetColumnDescription(int columnIdentifier) |
| 0 | 179 | | { |
| 0 | 180 | | ColumnDescription returnColumnDescription = new ColumnDescription(); |
| | 181 | |
|
| 0 | 182 | | ref ColumnEntry columnEntry = ref m_ColumnIdentifierToDenseIndexMap[columnIdentifier]; |
| | 183 | |
|
| 0 | 184 | | returnColumnDescription.Identifier = columnIdentifier; |
| 0 | 185 | | returnColumnDescription.Name = m_AllColumnNames[(int)columnEntry.ColumnType][columnEntry.ColumnDenseIndex]; |
| 0 | 186 | | returnColumnDescription.SortOrder = m_ColumnIdentifierToSortOrderMap[columnIdentifier]; |
| | 187 | |
|
| 0 | 188 | | return returnColumnDescription; |
| 0 | 189 | | } |
| | 190 | |
|
| | 191 | | /// <inheritdoc /> |
| | 192 | | public override ColumnDescription GetColumnDescriptionByOrder(int order) |
| 4 | 193 | | { |
| 4 | 194 | | int idAtOrderedIndex = m_SortedOrderToColumnIdentifierMap[order]; |
| 4 | 195 | | ref ColumnEntry columnEntry = ref m_ColumnIdentifierToDenseIndexMap[idAtOrderedIndex]; |
| | 196 | |
|
| 4 | 197 | | string columnName = m_AllColumnNames[(int)columnEntry.ColumnType][columnEntry.ColumnDenseIndex]; |
| | 198 | |
|
| 4 | 199 | | return new ColumnDescription |
| | 200 | | { |
| | 201 | | Identifier = idAtOrderedIndex, Name = columnName, Type = columnEntry.ColumnType, SortOrder = order |
| | 202 | | }; |
| 4 | 203 | | } |
| | 204 | |
|
| | 205 | | /// <inheritdoc /> |
| | 206 | | public override ColumnDescription[] GetAllColumnDescriptions() |
| 29 | 207 | | { |
| 29 | 208 | | if (m_CombinedColumnCount == 0) |
| 1 | 209 | | { |
| 1 | 210 | | return null; |
| | 211 | | } |
| | 212 | |
|
| 28 | 213 | | ColumnDescription[] returnArray = new ColumnDescription[m_CombinedColumnCount]; |
| | 214 | |
|
| 298 | 215 | | for (int i = 0; i < m_CombinedColumnCount; i++) |
| 121 | 216 | | { |
| 121 | 217 | | int columnID = m_SortedOrderToColumnIdentifierMap[i]; |
| 121 | 218 | | AssertColumnIdentifierValid(columnID); |
| 121 | 219 | | ref ColumnEntry entryForID = ref m_ColumnIdentifierToDenseIndexMap[columnID]; |
| 121 | 220 | | ref ArrayHolder<string> nameColumnsForType = ref m_AllColumnNames[(int)entryForID.ColumnType]; |
| | 221 | |
|
| 121 | 222 | | string name = nameColumnsForType[entryForID.ColumnDenseIndex]; |
| | 223 | |
|
| 121 | 224 | | returnArray[i] = new ColumnDescription |
| | 225 | | { |
| | 226 | | Name = name, Identifier = columnID, Type = entryForID.ColumnType, SortOrder = i |
| | 227 | | }; |
| 121 | 228 | | } |
| | 229 | |
|
| 28 | 230 | | return returnArray; |
| 29 | 231 | | } |
| | 232 | |
|
| | 233 | | internal void AssertColumnIdentifierValid(int columnID) |
| 1145 | 234 | | { |
| 1145 | 235 | | if (columnID < 0 || columnID >= m_ColumnIdentifierToDenseIndexMap.Length) |
| 0 | 236 | | { |
| 0 | 237 | | throw new ArgumentException("Invalid column outside valid ID range: " + columnID); |
| | 238 | | } |
| | 239 | |
|
| 1145 | 240 | | ref ColumnEntry columnEntry = ref m_ColumnIdentifierToDenseIndexMap[columnID]; |
| | 241 | |
|
| 1145 | 242 | | if (columnEntry.ColumnType == Serializable.SerializableTypes.Invalid) |
| 0 | 243 | | { |
| 0 | 244 | | throw new ArgumentException("Invalid column pointing to deallocated entry: " + columnID); |
| | 245 | | } |
| 1145 | 246 | | } |
| | 247 | |
|
| | 248 | | internal void AssertRowIdentifierValid(int rowID) |
| 921 | 249 | | { |
| 921 | 250 | | if (rowID < 0 || rowID >= m_RowIdentifierToDenseIndexMap.Length) |
| 0 | 251 | | { |
| 0 | 252 | | throw new ArgumentException("Invalid row outside valid ID range: " + rowID); |
| | 253 | | } |
| | 254 | |
|
| 921 | 255 | | int rowIndex = m_RowIdentifierToDenseIndexMap[rowID]; |
| | 256 | |
|
| 921 | 257 | | if (rowIndex >= m_RowCount || rowIndex < 0) |
| 0 | 258 | | { |
| 0 | 259 | | throw new ArgumentException("Invalid row outside valid ID range: " + rowID); |
| | 260 | | } |
| 921 | 261 | | } |
| | 262 | |
|
| | 263 | | /// <inheritdoc /> |
| | 264 | | public override void SetColumnName(int columnIdentifier, string columnName) |
| 30 | 265 | | { |
| 30 | 266 | | AssertColumnIdentifierValid(columnIdentifier); |
| 30 | 267 | | ref ColumnEntry columnEntry = ref m_ColumnIdentifierToDenseIndexMap[columnIdentifier]; |
| 30 | 268 | | m_AllColumnNames[(int)columnEntry.ColumnType][columnEntry.ColumnDenseIndex] = columnName; |
| 30 | 269 | | } |
| | 270 | |
|
| | 271 | | /// <inheritdoc /> |
| | 272 | | public override string GetColumnName(int columnIdentifier) |
| 60 | 273 | | { |
| 60 | 274 | | AssertColumnIdentifierValid(columnIdentifier); |
| 60 | 275 | | ref ColumnEntry columnEntry = ref m_ColumnIdentifierToDenseIndexMap[columnIdentifier]; |
| 60 | 276 | | return m_AllColumnNames[(int)columnEntry.ColumnType][columnEntry.ColumnDenseIndex]; |
| 60 | 277 | | } |
| | 278 | |
|
| | 279 | |
|
| | 280 | | /// <inheritdoc /> |
| | 281 | | public override void SetRowName(int rowIdentifier, string rowName) |
| 10 | 282 | | { |
| 10 | 283 | | AssertRowIdentifierValid(rowIdentifier); |
| 10 | 284 | | int rowDenseIndex = m_RowIdentifierToDenseIndexMap[rowIdentifier]; |
| 10 | 285 | | m_RowNames[rowDenseIndex] = rowName; |
| 10 | 286 | | } |
| | 287 | |
|
| | 288 | | /// <inheritdoc /> |
| | 289 | | public override string GetRowName(int rowIdentifier) |
| 21 | 290 | | { |
| 21 | 291 | | AssertRowIdentifierValid(rowIdentifier); |
| 21 | 292 | | int rowDenseIndex = m_RowIdentifierToDenseIndexMap[rowIdentifier]; |
| 21 | 293 | | return m_RowNames[rowDenseIndex]; |
| 21 | 294 | | } |
| | 295 | |
|
| | 296 | | public ref string GetRowNameRef(int rowIdentifier) |
| 20 | 297 | | { |
| 20 | 298 | | AssertRowIdentifierValid(rowIdentifier); |
| 20 | 299 | | int rowDenseIndex = m_RowIdentifierToDenseIndexMap[rowIdentifier]; |
| 20 | 300 | | return ref m_RowNames[rowDenseIndex]; |
| 20 | 301 | | } |
| | 302 | |
|
| | 303 | | public ref string GetColumnNameRef(int columnIdentifier) |
| 60 | 304 | | { |
| 60 | 305 | | AssertColumnIdentifierValid(columnIdentifier); |
| 60 | 306 | | ref ColumnEntry columnEntry = ref m_ColumnIdentifierToDenseIndexMap[columnIdentifier]; |
| 60 | 307 | | return ref m_AllColumnNames[(int)columnEntry.ColumnType][columnEntry.ColumnDenseIndex]; |
| 60 | 308 | | } |
| | 309 | |
|
| | 310 | | /// <inheritdoc /> |
| | 311 | | public override int AddRow(string rowName = null, int insertAtRowIdentifier = -1) |
| 56 | 312 | | { |
| 56 | 313 | | if (insertAtRowIdentifier >= 0) |
| 0 | 314 | | { |
| 0 | 315 | | AssertRowIdentifierValid(insertAtRowIdentifier); |
| 0 | 316 | | } |
| | 317 | |
|
| 56 | 318 | | int rowID = m_RowEntriesFreeListHead; |
| 56 | 319 | | int rowIDToDenseIndexMapLength = m_RowIdentifierToDenseIndexMap?.Length ?? 0; |
| 56 | 320 | | if (rowID >= rowIDToDenseIndexMapLength) |
| 21 | 321 | | { |
| 21 | 322 | | int newSize = rowID * 2; |
| 21 | 323 | | newSize = newSize == 0 ? 1 : newSize; |
| 21 | 324 | | Array.Resize(ref m_RowIdentifierToDenseIndexMap, newSize); |
| 188 | 325 | | for (int i = rowID; i < newSize; i++) |
| 73 | 326 | | { |
| 73 | 327 | | m_RowIdentifierToDenseIndexMap[i] = i + 1; |
| 73 | 328 | | } |
| 21 | 329 | | } |
| | 330 | |
|
| 56 | 331 | | int denseIndexToIDMapLength = m_RowDenseIndexToIDMap?.Length ?? 0; |
| 56 | 332 | | Array.Resize(ref m_RowDenseIndexToIDMap, denseIndexToIDMapLength + 1); |
| 56 | 333 | | Array.Resize(ref m_RowNames, denseIndexToIDMapLength + 1); |
| | 334 | |
|
| 56 | 335 | | int insertAt = insertAtRowIdentifier < 0 |
| | 336 | | ? m_RowCount |
| | 337 | | : m_RowIdentifierToDenseIndexMap[insertAtRowIdentifier]; |
| | 338 | |
|
| 112 | 339 | | for (int i = denseIndexToIDMapLength; i > insertAt; i--) |
| 0 | 340 | | { |
| 0 | 341 | | int currentRowID = m_RowDenseIndexToIDMap[i - 1]; |
| 0 | 342 | | m_RowDenseIndexToIDMap[i] = currentRowID; |
| | 343 | |
|
| 0 | 344 | | m_RowIdentifierToDenseIndexMap[currentRowID] = i; |
| | 345 | |
|
| 0 | 346 | | m_RowNames[i] = m_RowNames[i - 1]; |
| 0 | 347 | | } |
| | 348 | |
|
| 56 | 349 | | m_RowEntriesFreeListHead = m_RowIdentifierToDenseIndexMap[rowID]; |
| 56 | 350 | | m_RowIdentifierToDenseIndexMap[rowID] = insertAt; |
| 56 | 351 | | m_RowDenseIndexToIDMap[insertAt] = rowID; |
| 56 | 352 | | m_RowNames[insertAt] = rowName == null ? rowID.ToString() : rowName; |
| | 353 | |
|
| 56 | 354 | | InsertRowsOfTypeInternal(ref m_AllStringColumns, insertAt, 1); |
| 56 | 355 | | InsertRowsOfTypeInternal(ref m_AllBoolColumns, insertAt, 1); |
| 56 | 356 | | InsertRowsOfTypeInternal(ref m_AllCharColumns, insertAt, 1); |
| 56 | 357 | | InsertRowsOfTypeInternal(ref m_AllSByteColumns, insertAt, 1); |
| 56 | 358 | | InsertRowsOfTypeInternal(ref m_AllByteColumns, insertAt, 1); |
| 56 | 359 | | InsertRowsOfTypeInternal(ref m_AllShortColumns, insertAt, 1); |
| 56 | 360 | | InsertRowsOfTypeInternal(ref m_AllUShortColumns, insertAt, 1); |
| 56 | 361 | | InsertRowsOfTypeInternal(ref m_AllIntColumns, insertAt, 1); |
| 56 | 362 | | InsertRowsOfTypeInternal(ref m_AllUIntColumns, insertAt, 1); |
| 56 | 363 | | InsertRowsOfTypeInternal(ref m_AllLongColumns, insertAt, 1); |
| 56 | 364 | | InsertRowsOfTypeInternal(ref m_AllULongColumns, insertAt, 1); |
| 56 | 365 | | InsertRowsOfTypeInternal(ref m_AllFloatColumns, insertAt, 1); |
| 56 | 366 | | InsertRowsOfTypeInternal(ref m_AllDoubleColumns, insertAt, 1); |
| 56 | 367 | | InsertRowsOfTypeInternal(ref m_AllVector2Columns, insertAt, 1); |
| 56 | 368 | | InsertRowsOfTypeInternal(ref m_AllVector3Columns, insertAt, 1); |
| 56 | 369 | | InsertRowsOfTypeInternal(ref m_AllVector4Columns, insertAt, 1); |
| 56 | 370 | | InsertRowsOfTypeInternal(ref m_AllVector2IntColumns, insertAt, 1); |
| 56 | 371 | | InsertRowsOfTypeInternal(ref m_AllVector3IntColumns, insertAt, 1); |
| 56 | 372 | | InsertRowsOfTypeInternal(ref m_AllQuaternionColumns, insertAt, 1); |
| 56 | 373 | | InsertRowsOfTypeInternal(ref m_AllRectColumns, insertAt, 1); |
| 56 | 374 | | InsertRowsOfTypeInternal(ref m_AllRectIntColumns, insertAt, 1); |
| 56 | 375 | | InsertRowsOfTypeInternal(ref m_AllColorColumns, insertAt, 1); |
| 56 | 376 | | InsertRowsOfTypeInternal(ref m_AllLayerMaskColumns, insertAt, 1); |
| 56 | 377 | | InsertRowsOfTypeInternal(ref m_AllBoundsColumns, insertAt, 1); |
| 56 | 378 | | InsertRowsOfTypeInternal(ref m_AllBoundsIntColumns, insertAt, 1); |
| 56 | 379 | | InsertRowsOfTypeInternal(ref m_AllHash128Columns, insertAt, 1); |
| 56 | 380 | | InsertRowsOfTypeInternal(ref m_AllGradientColumns, insertAt, 1); |
| 56 | 381 | | InsertRowsOfTypeInternal(ref m_AllAnimationCurveColumns, insertAt, 1); |
| 56 | 382 | | InsertRowsOfTypeInternal(ref m_AllObjectRefColumns, insertAt, 1); |
| 56 | 383 | | InsertRowsOfTypeInternal(ref m_AllEnumIntColumns, insertAt, 1); |
| | 384 | |
|
| 56 | 385 | | ++m_RowCount; |
| 56 | 386 | | m_DataVersion++; |
| | 387 | |
|
| 56 | 388 | | return rowID; |
| 56 | 389 | | } |
| | 390 | |
|
| | 391 | | public void AddRows(int numberOfNewRows, string[] rowNames = null, int insertAtRowID = -1) |
| 0 | 392 | | { |
| 0 | 393 | | if (insertAtRowID >= 0) |
| 0 | 394 | | { |
| 0 | 395 | | AssertRowIdentifierValid(insertAtRowID); |
| 0 | 396 | | } |
| | 397 | |
|
| 0 | 398 | | int rowIDToDenseIndexMapLength = m_RowIdentifierToDenseIndexMap?.Length ?? 0; |
| 0 | 399 | | int newCount = m_RowCount + numberOfNewRows; |
| 0 | 400 | | if (newCount > rowIDToDenseIndexMapLength) |
| 0 | 401 | | { |
| 0 | 402 | | int newSize = newCount; |
| 0 | 403 | | --newSize; |
| 0 | 404 | | newSize |= newSize >> 1; |
| 0 | 405 | | newSize |= newSize >> 2; |
| 0 | 406 | | newSize |= newSize >> 4; |
| 0 | 407 | | newSize |= newSize >> 8; |
| 0 | 408 | | newSize |= newSize >> 16; |
| 0 | 409 | | ++newSize; |
| | 410 | |
|
| 0 | 411 | | newSize = newSize == 0 ? 1 : newSize; |
| 0 | 412 | | Array.Resize(ref m_RowIdentifierToDenseIndexMap, newSize); |
| 0 | 413 | | for (int i = rowIDToDenseIndexMapLength; i < newSize; i++) |
| 0 | 414 | | { |
| 0 | 415 | | m_RowIdentifierToDenseIndexMap[i] = i + 1; |
| 0 | 416 | | } |
| 0 | 417 | | } |
| | 418 | |
|
| 0 | 419 | | int denseIndexToIDMapLength = m_RowDenseIndexToIDMap?.Length ?? 0; |
| 0 | 420 | | Array.Resize(ref m_RowDenseIndexToIDMap, denseIndexToIDMapLength + numberOfNewRows); |
| 0 | 421 | | Array.Resize(ref rowNames, denseIndexToIDMapLength + numberOfNewRows); |
| | 422 | |
|
| 0 | 423 | | int insertAt = insertAtRowID < 0 ? m_RowCount : m_RowIdentifierToDenseIndexMap[insertAtRowID]; |
| | 424 | |
|
| 0 | 425 | | for (int i = denseIndexToIDMapLength; i > insertAt + numberOfNewRows - 1; i--) |
| 0 | 426 | | { |
| 0 | 427 | | int currentRowID = m_RowDenseIndexToIDMap[i - numberOfNewRows]; |
| 0 | 428 | | m_RowDenseIndexToIDMap[i] = currentRowID; |
| | 429 | |
|
| 0 | 430 | | m_RowIdentifierToDenseIndexMap[currentRowID] = i; |
| | 431 | |
|
| 0 | 432 | | rowNames[i] = rowNames[i - numberOfNewRows]; |
| 0 | 433 | | } |
| | 434 | |
|
| 0 | 435 | | int freeListHead = m_RowEntriesFreeListHead; |
| | 436 | |
|
| 0 | 437 | | for (int i = 0; i < numberOfNewRows; i++) |
| 0 | 438 | | { |
| 0 | 439 | | int rowID = freeListHead; |
| 0 | 440 | | freeListHead = m_RowIdentifierToDenseIndexMap[rowID]; |
| 0 | 441 | | m_RowIdentifierToDenseIndexMap[rowID] = insertAt + i; |
| 0 | 442 | | m_RowDenseIndexToIDMap[insertAt + i] = rowID; |
| 0 | 443 | | } |
| | 444 | |
|
| 0 | 445 | | int numberOfNewRowNames = rowNames?.Length ?? 0; |
| 0 | 446 | | string emptyString = string.Empty; |
| 0 | 447 | | for (int i = 0; i < numberOfNewRowNames; i++) |
| 0 | 448 | | { |
| 0 | 449 | | string currentRowName = rowNames[i]; |
| 0 | 450 | | int rowIDAt = m_RowDenseIndexToIDMap[insertAt + i]; |
| 0 | 451 | | rowNames[insertAt + i] = currentRowName == null ? rowIDAt.ToString() : currentRowName; |
| 0 | 452 | | } |
| | 453 | |
|
| 0 | 454 | | for (int i = numberOfNewRowNames; i < numberOfNewRows; i++) |
| 0 | 455 | | { |
| 0 | 456 | | int rowIDAt = m_RowDenseIndexToIDMap[insertAt + i]; |
| 0 | 457 | | rowNames[insertAt + i] = rowIDAt.ToString(); |
| 0 | 458 | | } |
| | 459 | |
|
| 0 | 460 | | m_RowEntriesFreeListHead = freeListHead; |
| | 461 | |
|
| 0 | 462 | | InsertRowsOfTypeInternal(ref m_AllStringColumns, insertAt, numberOfNewRows); |
| 0 | 463 | | InsertRowsOfTypeInternal(ref m_AllBoolColumns, insertAt, numberOfNewRows); |
| 0 | 464 | | InsertRowsOfTypeInternal(ref m_AllCharColumns, insertAt, numberOfNewRows); |
| 0 | 465 | | InsertRowsOfTypeInternal(ref m_AllSByteColumns, insertAt, numberOfNewRows); |
| 0 | 466 | | InsertRowsOfTypeInternal(ref m_AllByteColumns, insertAt, numberOfNewRows); |
| 0 | 467 | | InsertRowsOfTypeInternal(ref m_AllShortColumns, insertAt, numberOfNewRows); |
| 0 | 468 | | InsertRowsOfTypeInternal(ref m_AllUShortColumns, insertAt, numberOfNewRows); |
| 0 | 469 | | InsertRowsOfTypeInternal(ref m_AllIntColumns, insertAt, numberOfNewRows); |
| 0 | 470 | | InsertRowsOfTypeInternal(ref m_AllUIntColumns, insertAt, numberOfNewRows); |
| 0 | 471 | | InsertRowsOfTypeInternal(ref m_AllLongColumns, insertAt, numberOfNewRows); |
| 0 | 472 | | InsertRowsOfTypeInternal(ref m_AllULongColumns, insertAt, numberOfNewRows); |
| 0 | 473 | | InsertRowsOfTypeInternal(ref m_AllFloatColumns, insertAt, numberOfNewRows); |
| 0 | 474 | | InsertRowsOfTypeInternal(ref m_AllDoubleColumns, insertAt, numberOfNewRows); |
| 0 | 475 | | InsertRowsOfTypeInternal(ref m_AllVector2Columns, insertAt, numberOfNewRows); |
| 0 | 476 | | InsertRowsOfTypeInternal(ref m_AllVector3Columns, insertAt, numberOfNewRows); |
| 0 | 477 | | InsertRowsOfTypeInternal(ref m_AllVector4Columns, insertAt, numberOfNewRows); |
| 0 | 478 | | InsertRowsOfTypeInternal(ref m_AllVector2IntColumns, insertAt, numberOfNewRows); |
| 0 | 479 | | InsertRowsOfTypeInternal(ref m_AllVector3IntColumns, insertAt, numberOfNewRows); |
| 0 | 480 | | InsertRowsOfTypeInternal(ref m_AllQuaternionColumns, insertAt, numberOfNewRows); |
| 0 | 481 | | InsertRowsOfTypeInternal(ref m_AllRectColumns, insertAt, numberOfNewRows); |
| 0 | 482 | | InsertRowsOfTypeInternal(ref m_AllRectIntColumns, insertAt, numberOfNewRows); |
| 0 | 483 | | InsertRowsOfTypeInternal(ref m_AllColorColumns, insertAt, numberOfNewRows); |
| 0 | 484 | | InsertRowsOfTypeInternal(ref m_AllLayerMaskColumns, insertAt, numberOfNewRows); |
| 0 | 485 | | InsertRowsOfTypeInternal(ref m_AllBoundsColumns, insertAt, numberOfNewRows); |
| 0 | 486 | | InsertRowsOfTypeInternal(ref m_AllBoundsIntColumns, insertAt, numberOfNewRows); |
| 0 | 487 | | InsertRowsOfTypeInternal(ref m_AllHash128Columns, insertAt, numberOfNewRows); |
| 0 | 488 | | InsertRowsOfTypeInternal(ref m_AllGradientColumns, insertAt, numberOfNewRows); |
| 0 | 489 | | InsertRowsOfTypeInternal(ref m_AllAnimationCurveColumns, insertAt, numberOfNewRows); |
| 0 | 490 | | InsertRowsOfTypeInternal(ref m_AllObjectRefColumns, insertAt, numberOfNewRows); |
| 0 | 491 | | InsertRowsOfTypeInternal(ref m_AllEnumIntColumns, insertAt, numberOfNewRows); |
| | 492 | |
|
| 0 | 493 | | m_RowCount += numberOfNewRows; |
| 0 | 494 | | m_DataVersion++; |
| 0 | 495 | | } |
| | 496 | |
|
| | 497 | | public void AddRows(int numberOfNewRows, ref int[] rowIDs, string[] rowNames = null, int insertAtRowID = -1) |
| 0 | 498 | | { |
| 0 | 499 | | if (insertAtRowID >= 0) |
| 0 | 500 | | { |
| 0 | 501 | | AssertRowIdentifierValid(insertAtRowID); |
| 0 | 502 | | } |
| | 503 | |
|
| 0 | 504 | | int rowIDToDenseIndexMapLength = m_RowIdentifierToDenseIndexMap?.Length ?? 0; |
| 0 | 505 | | int newCount = m_RowCount + numberOfNewRows; |
| 0 | 506 | | if (newCount > rowIDToDenseIndexMapLength) |
| 0 | 507 | | { |
| 0 | 508 | | int newSize = newCount; |
| 0 | 509 | | --newSize; |
| 0 | 510 | | newSize |= newSize >> 1; |
| 0 | 511 | | newSize |= newSize >> 2; |
| 0 | 512 | | newSize |= newSize >> 4; |
| 0 | 513 | | newSize |= newSize >> 8; |
| 0 | 514 | | newSize |= newSize >> 16; |
| 0 | 515 | | ++newSize; |
| | 516 | |
|
| 0 | 517 | | newSize = newSize == 0 ? 1 : newSize; |
| 0 | 518 | | Array.Resize(ref m_RowIdentifierToDenseIndexMap, newSize); |
| 0 | 519 | | for (int i = rowIDToDenseIndexMapLength; i < newSize; i++) |
| 0 | 520 | | { |
| 0 | 521 | | m_RowIdentifierToDenseIndexMap[i] = i + 1; |
| 0 | 522 | | } |
| 0 | 523 | | } |
| | 524 | |
|
| 0 | 525 | | int denseIndexToIDMapLength = m_RowDenseIndexToIDMap?.Length ?? 0; |
| 0 | 526 | | Array.Resize(ref m_RowDenseIndexToIDMap, denseIndexToIDMapLength + numberOfNewRows); |
| | 527 | |
|
| 0 | 528 | | int insertAt = insertAtRowID < 0 ? m_RowCount : m_RowIdentifierToDenseIndexMap[insertAtRowID]; |
| | 529 | |
|
| 0 | 530 | | for (int i = denseIndexToIDMapLength; i > insertAt + numberOfNewRows - 1; i--) |
| 0 | 531 | | { |
| 0 | 532 | | int currentRowID = m_RowDenseIndexToIDMap[i - numberOfNewRows]; |
| 0 | 533 | | m_RowDenseIndexToIDMap[i] = currentRowID; |
| | 534 | |
|
| 0 | 535 | | m_RowIdentifierToDenseIndexMap[currentRowID] = i; |
| | 536 | |
|
| 0 | 537 | | rowNames[i] = rowNames[i - numberOfNewRows]; |
| 0 | 538 | | } |
| | 539 | |
|
| 0 | 540 | | int freeListHead = m_RowEntriesFreeListHead; |
| | 541 | |
|
| 0 | 542 | | for (int i = 0; i < numberOfNewRows; i++) |
| 0 | 543 | | { |
| 0 | 544 | | int rowID = freeListHead; |
| 0 | 545 | | freeListHead = m_RowIdentifierToDenseIndexMap[rowID]; |
| 0 | 546 | | m_RowIdentifierToDenseIndexMap[rowID] = insertAt + i; |
| 0 | 547 | | m_RowDenseIndexToIDMap[insertAt + i] = rowID; |
| 0 | 548 | | rowIDs[i] = rowID; |
| 0 | 549 | | } |
| | 550 | |
|
| 0 | 551 | | int numberOfNewRowNames = rowNames?.Length ?? 0; |
| 0 | 552 | | for (int i = 0; i < numberOfNewRowNames; i++) |
| 0 | 553 | | { |
| 0 | 554 | | string currentRowName = rowNames[i]; |
| 0 | 555 | | int rowIDAt = m_RowDenseIndexToIDMap[insertAt + i]; |
| 0 | 556 | | rowNames[insertAt + i] = currentRowName == null ? rowIDAt.ToString() : currentRowName; |
| 0 | 557 | | } |
| | 558 | |
|
| 0 | 559 | | for (int i = numberOfNewRowNames; i < numberOfNewRows; i++) |
| 0 | 560 | | { |
| 0 | 561 | | int rowIDAt = m_RowDenseIndexToIDMap[insertAt + i]; |
| 0 | 562 | | rowNames[insertAt + i] = rowIDAt.ToString(); |
| 0 | 563 | | } |
| | 564 | |
|
| 0 | 565 | | m_RowEntriesFreeListHead = freeListHead; |
| | 566 | |
|
| 0 | 567 | | InsertRowsOfTypeInternal(ref m_AllStringColumns, insertAt, numberOfNewRows); |
| 0 | 568 | | InsertRowsOfTypeInternal(ref m_AllBoolColumns, insertAt, numberOfNewRows); |
| 0 | 569 | | InsertRowsOfTypeInternal(ref m_AllCharColumns, insertAt, numberOfNewRows); |
| 0 | 570 | | InsertRowsOfTypeInternal(ref m_AllSByteColumns, insertAt, numberOfNewRows); |
| 0 | 571 | | InsertRowsOfTypeInternal(ref m_AllByteColumns, insertAt, numberOfNewRows); |
| 0 | 572 | | InsertRowsOfTypeInternal(ref m_AllShortColumns, insertAt, numberOfNewRows); |
| 0 | 573 | | InsertRowsOfTypeInternal(ref m_AllUShortColumns, insertAt, numberOfNewRows); |
| 0 | 574 | | InsertRowsOfTypeInternal(ref m_AllIntColumns, insertAt, numberOfNewRows); |
| 0 | 575 | | InsertRowsOfTypeInternal(ref m_AllUIntColumns, insertAt, numberOfNewRows); |
| 0 | 576 | | InsertRowsOfTypeInternal(ref m_AllLongColumns, insertAt, numberOfNewRows); |
| 0 | 577 | | InsertRowsOfTypeInternal(ref m_AllULongColumns, insertAt, numberOfNewRows); |
| 0 | 578 | | InsertRowsOfTypeInternal(ref m_AllFloatColumns, insertAt, numberOfNewRows); |
| 0 | 579 | | InsertRowsOfTypeInternal(ref m_AllDoubleColumns, insertAt, numberOfNewRows); |
| 0 | 580 | | InsertRowsOfTypeInternal(ref m_AllVector2Columns, insertAt, numberOfNewRows); |
| 0 | 581 | | InsertRowsOfTypeInternal(ref m_AllVector3Columns, insertAt, numberOfNewRows); |
| 0 | 582 | | InsertRowsOfTypeInternal(ref m_AllVector4Columns, insertAt, numberOfNewRows); |
| 0 | 583 | | InsertRowsOfTypeInternal(ref m_AllVector2IntColumns, insertAt, numberOfNewRows); |
| 0 | 584 | | InsertRowsOfTypeInternal(ref m_AllVector3IntColumns, insertAt, numberOfNewRows); |
| 0 | 585 | | InsertRowsOfTypeInternal(ref m_AllQuaternionColumns, insertAt, numberOfNewRows); |
| 0 | 586 | | InsertRowsOfTypeInternal(ref m_AllRectColumns, insertAt, numberOfNewRows); |
| 0 | 587 | | InsertRowsOfTypeInternal(ref m_AllRectIntColumns, insertAt, numberOfNewRows); |
| 0 | 588 | | InsertRowsOfTypeInternal(ref m_AllColorColumns, insertAt, numberOfNewRows); |
| 0 | 589 | | InsertRowsOfTypeInternal(ref m_AllLayerMaskColumns, insertAt, numberOfNewRows); |
| 0 | 590 | | InsertRowsOfTypeInternal(ref m_AllBoundsColumns, insertAt, numberOfNewRows); |
| 0 | 591 | | InsertRowsOfTypeInternal(ref m_AllBoundsIntColumns, insertAt, numberOfNewRows); |
| 0 | 592 | | InsertRowsOfTypeInternal(ref m_AllHash128Columns, insertAt, numberOfNewRows); |
| 0 | 593 | | InsertRowsOfTypeInternal(ref m_AllGradientColumns, insertAt, numberOfNewRows); |
| 0 | 594 | | InsertRowsOfTypeInternal(ref m_AllAnimationCurveColumns, insertAt, numberOfNewRows); |
| 0 | 595 | | InsertRowsOfTypeInternal(ref m_AllObjectRefColumns, insertAt, numberOfNewRows); |
| 0 | 596 | | InsertRowsOfTypeInternal(ref m_AllEnumIntColumns, insertAt, numberOfNewRows); |
| | 597 | |
|
| 0 | 598 | | m_RowCount += numberOfNewRows; |
| 0 | 599 | | m_DataVersion++; |
| 0 | 600 | | } |
| | 601 | |
|
| | 602 | | /// <inheritdoc /> |
| | 603 | | public override void RemoveRow(int rowIdentifier) |
| 0 | 604 | | { |
| 0 | 605 | | AssertRowIdentifierValid(rowIdentifier); |
| 0 | 606 | | int rowDenseIndex = m_RowIdentifierToDenseIndexMap[rowIdentifier]; |
| 0 | 607 | | for (int i = rowDenseIndex + 1; i < m_RowCount; i++) |
| 0 | 608 | | { |
| 0 | 609 | | int currentRowID = m_RowDenseIndexToIDMap[i]; |
| 0 | 610 | | m_RowIdentifierToDenseIndexMap[currentRowID] = i - 1; |
| 0 | 611 | | m_RowDenseIndexToIDMap[i - 1] = currentRowID; |
| 0 | 612 | | m_RowNames[i - 1] = m_RowNames[i]; |
| 0 | 613 | | } |
| | 614 | |
|
| 0 | 615 | | m_RowIdentifierToDenseIndexMap[rowIdentifier] = m_RowEntriesFreeListHead; |
| 0 | 616 | | m_RowEntriesFreeListHead = rowIdentifier; |
| 0 | 617 | | Array.Resize(ref m_RowDenseIndexToIDMap, m_RowCount - 1); |
| 0 | 618 | | Array.Resize(ref m_RowNames, m_RowCount - 1); |
| | 619 | |
|
| 0 | 620 | | DeleteRowsOfTypeInternal(ref m_AllStringColumns, rowDenseIndex, 1); |
| 0 | 621 | | DeleteRowsOfTypeInternal(ref m_AllBoolColumns, rowDenseIndex, 1); |
| 0 | 622 | | DeleteRowsOfTypeInternal(ref m_AllCharColumns, rowDenseIndex, 1); |
| 0 | 623 | | DeleteRowsOfTypeInternal(ref m_AllSByteColumns, rowDenseIndex, 1); |
| 0 | 624 | | DeleteRowsOfTypeInternal(ref m_AllByteColumns, rowDenseIndex, 1); |
| 0 | 625 | | DeleteRowsOfTypeInternal(ref m_AllShortColumns, rowDenseIndex, 1); |
| 0 | 626 | | DeleteRowsOfTypeInternal(ref m_AllUShortColumns, rowDenseIndex, 1); |
| 0 | 627 | | DeleteRowsOfTypeInternal(ref m_AllIntColumns, rowDenseIndex, 1); |
| 0 | 628 | | DeleteRowsOfTypeInternal(ref m_AllUIntColumns, rowDenseIndex, 1); |
| 0 | 629 | | DeleteRowsOfTypeInternal(ref m_AllLongColumns, rowDenseIndex, 1); |
| 0 | 630 | | DeleteRowsOfTypeInternal(ref m_AllULongColumns, rowDenseIndex, 1); |
| 0 | 631 | | DeleteRowsOfTypeInternal(ref m_AllFloatColumns, rowDenseIndex, 1); |
| 0 | 632 | | DeleteRowsOfTypeInternal(ref m_AllDoubleColumns, rowDenseIndex, 1); |
| 0 | 633 | | DeleteRowsOfTypeInternal(ref m_AllVector2Columns, rowDenseIndex, 1); |
| 0 | 634 | | DeleteRowsOfTypeInternal(ref m_AllVector3Columns, rowDenseIndex, 1); |
| 0 | 635 | | DeleteRowsOfTypeInternal(ref m_AllVector4Columns, rowDenseIndex, 1); |
| 0 | 636 | | DeleteRowsOfTypeInternal(ref m_AllVector2IntColumns, rowDenseIndex, 1); |
| 0 | 637 | | DeleteRowsOfTypeInternal(ref m_AllVector3IntColumns, rowDenseIndex, 1); |
| 0 | 638 | | DeleteRowsOfTypeInternal(ref m_AllQuaternionColumns, rowDenseIndex, 1); |
| 0 | 639 | | DeleteRowsOfTypeInternal(ref m_AllRectColumns, rowDenseIndex, 1); |
| 0 | 640 | | DeleteRowsOfTypeInternal(ref m_AllRectIntColumns, rowDenseIndex, 1); |
| 0 | 641 | | DeleteRowsOfTypeInternal(ref m_AllColorColumns, rowDenseIndex, 1); |
| 0 | 642 | | DeleteRowsOfTypeInternal(ref m_AllLayerMaskColumns, rowDenseIndex, 1); |
| 0 | 643 | | DeleteRowsOfTypeInternal(ref m_AllBoundsColumns, rowDenseIndex, 1); |
| 0 | 644 | | DeleteRowsOfTypeInternal(ref m_AllBoundsIntColumns, rowDenseIndex, 1); |
| 0 | 645 | | DeleteRowsOfTypeInternal(ref m_AllHash128Columns, rowDenseIndex, 1); |
| 0 | 646 | | DeleteRowsOfTypeInternal(ref m_AllGradientColumns, rowDenseIndex, 1); |
| 0 | 647 | | DeleteRowsOfTypeInternal(ref m_AllAnimationCurveColumns, rowDenseIndex, 1); |
| 0 | 648 | | DeleteRowsOfTypeInternal(ref m_AllObjectRefColumns, rowDenseIndex, 1); |
| 0 | 649 | | DeleteRowsOfTypeInternal(ref m_AllEnumIntColumns, rowDenseIndex, 1); |
| | 650 | |
|
| 0 | 651 | | --m_RowCount; |
| 0 | 652 | | m_DataVersion++; |
| 0 | 653 | | } |
| | 654 | |
|
| | 655 | | /// <inheritdoc /> |
| | 656 | | public override int AddColumn(Serializable.SerializableTypes columnType, string columnName, |
| | 657 | | int insertAtColumnIdentifier = -1) |
| 114 | 658 | | { |
| 114 | 659 | | switch (columnType) |
| | 660 | | { |
| | 661 | | case Serializable.SerializableTypes.String: |
| 13 | 662 | | return AddColumnInternal(columnName, ref m_AllStringColumns, Serializable.SerializableTypes.String, |
| | 663 | | insertAtColumnIdentifier); |
| | 664 | | case Serializable.SerializableTypes.Char: |
| 3 | 665 | | return AddColumnInternal(columnName, ref m_AllCharColumns, Serializable.SerializableTypes.Char, |
| | 666 | | insertAtColumnIdentifier); |
| | 667 | | case Serializable.SerializableTypes.Bool: |
| 4 | 668 | | return AddColumnInternal(columnName, ref m_AllBoolColumns, Serializable.SerializableTypes.Bool, |
| | 669 | | insertAtColumnIdentifier); |
| | 670 | | case Serializable.SerializableTypes.SByte: |
| 4 | 671 | | return AddColumnInternal(columnName, ref m_AllSByteColumns, Serializable.SerializableTypes.SByte, |
| | 672 | | insertAtColumnIdentifier); |
| | 673 | | case Serializable.SerializableTypes.Byte: |
| 3 | 674 | | return AddColumnInternal(columnName, ref m_AllByteColumns, Serializable.SerializableTypes.Byte, |
| | 675 | | insertAtColumnIdentifier); |
| | 676 | | case Serializable.SerializableTypes.Short: |
| 3 | 677 | | return AddColumnInternal(columnName, ref m_AllShortColumns, Serializable.SerializableTypes.Short, |
| | 678 | | insertAtColumnIdentifier); |
| | 679 | | case Serializable.SerializableTypes.UShort: |
| 3 | 680 | | return AddColumnInternal(columnName, ref m_AllUShortColumns, Serializable.SerializableTypes.UShort, |
| | 681 | | insertAtColumnIdentifier); |
| | 682 | | case Serializable.SerializableTypes.Int: |
| 3 | 683 | | return AddColumnInternal(columnName, ref m_AllIntColumns, Serializable.SerializableTypes.Int, |
| | 684 | | insertAtColumnIdentifier); |
| | 685 | | case Serializable.SerializableTypes.UInt: |
| 3 | 686 | | return AddColumnInternal(columnName, ref m_AllUIntColumns, Serializable.SerializableTypes.UInt, |
| | 687 | | insertAtColumnIdentifier); |
| | 688 | | case Serializable.SerializableTypes.Long: |
| 3 | 689 | | return AddColumnInternal(columnName, ref m_AllLongColumns, Serializable.SerializableTypes.Long, |
| | 690 | | insertAtColumnIdentifier); |
| | 691 | | case Serializable.SerializableTypes.ULong: |
| 3 | 692 | | return AddColumnInternal(columnName, ref m_AllULongColumns, Serializable.SerializableTypes.ULong, |
| | 693 | | insertAtColumnIdentifier); |
| | 694 | | case Serializable.SerializableTypes.Float: |
| 4 | 695 | | return AddColumnInternal(columnName, ref m_AllFloatColumns, Serializable.SerializableTypes.Float, |
| | 696 | | insertAtColumnIdentifier); |
| | 697 | | case Serializable.SerializableTypes.Double: |
| 4 | 698 | | return AddColumnInternal(columnName, ref m_AllDoubleColumns, Serializable.SerializableTypes.Double, |
| | 699 | | insertAtColumnIdentifier); |
| | 700 | | case Serializable.SerializableTypes.Vector2: |
| 5 | 701 | | return AddColumnInternal(columnName, ref m_AllVector2Columns, |
| | 702 | | Serializable.SerializableTypes.Vector2, |
| | 703 | | insertAtColumnIdentifier); |
| | 704 | | case Serializable.SerializableTypes.Vector3: |
| 3 | 705 | | return AddColumnInternal(columnName, ref m_AllVector3Columns, |
| | 706 | | Serializable.SerializableTypes.Vector3, |
| | 707 | | insertAtColumnIdentifier); |
| | 708 | | case Serializable.SerializableTypes.Vector4: |
| 3 | 709 | | return AddColumnInternal(columnName, ref m_AllVector4Columns, |
| | 710 | | Serializable.SerializableTypes.Vector4, |
| | 711 | | insertAtColumnIdentifier); |
| | 712 | | case Serializable.SerializableTypes.Vector2Int: |
| 3 | 713 | | return AddColumnInternal(columnName, ref m_AllVector2IntColumns, |
| | 714 | | Serializable.SerializableTypes.Vector2Int, insertAtColumnIdentifier); |
| | 715 | | case Serializable.SerializableTypes.Vector3Int: |
| 3 | 716 | | return AddColumnInternal(columnName, ref m_AllVector3IntColumns, |
| | 717 | | Serializable.SerializableTypes.Vector3Int, insertAtColumnIdentifier); |
| | 718 | | case Serializable.SerializableTypes.Quaternion: |
| 4 | 719 | | return AddColumnInternal(columnName, ref m_AllQuaternionColumns, |
| | 720 | | Serializable.SerializableTypes.Quaternion, insertAtColumnIdentifier); |
| | 721 | | case Serializable.SerializableTypes.Rect: |
| 3 | 722 | | return AddColumnInternal(columnName, ref m_AllRectColumns, Serializable.SerializableTypes.Rect, |
| | 723 | | insertAtColumnIdentifier); |
| | 724 | | case Serializable.SerializableTypes.RectInt: |
| 3 | 725 | | return AddColumnInternal(columnName, ref m_AllRectIntColumns, |
| | 726 | | Serializable.SerializableTypes.RectInt, |
| | 727 | | insertAtColumnIdentifier); |
| | 728 | | case Serializable.SerializableTypes.Color: |
| 3 | 729 | | return AddColumnInternal(columnName, ref m_AllColorColumns, Serializable.SerializableTypes.Color, |
| | 730 | | insertAtColumnIdentifier); |
| | 731 | | case Serializable.SerializableTypes.LayerMask: |
| 3 | 732 | | return AddColumnInternal(columnName, ref m_AllLayerMaskColumns, |
| | 733 | | Serializable.SerializableTypes.LayerMask, insertAtColumnIdentifier); |
| | 734 | | case Serializable.SerializableTypes.Bounds: |
| 9 | 735 | | return AddColumnInternal(columnName, ref m_AllBoundsColumns, Serializable.SerializableTypes.Bounds, |
| | 736 | | insertAtColumnIdentifier); |
| | 737 | | case Serializable.SerializableTypes.BoundsInt: |
| 3 | 738 | | return AddColumnInternal(columnName, ref m_AllBoundsIntColumns, |
| | 739 | | Serializable.SerializableTypes.BoundsInt, insertAtColumnIdentifier); |
| | 740 | | case Serializable.SerializableTypes.Hash128: |
| 3 | 741 | | return AddColumnInternal(columnName, ref m_AllHash128Columns, |
| | 742 | | Serializable.SerializableTypes.Hash128, |
| | 743 | | insertAtColumnIdentifier); |
| | 744 | | case Serializable.SerializableTypes.Gradient: |
| 3 | 745 | | return AddColumnInternal(columnName, ref m_AllGradientColumns, |
| | 746 | | Serializable.SerializableTypes.Gradient, insertAtColumnIdentifier); |
| | 747 | | case Serializable.SerializableTypes.AnimationCurve: |
| 3 | 748 | | return AddColumnInternal(columnName, ref m_AllAnimationCurveColumns, |
| | 749 | | Serializable.SerializableTypes.AnimationCurve, insertAtColumnIdentifier); |
| | 750 | | case Serializable.SerializableTypes.Object: |
| 4 | 751 | | return AddColumnInternal(columnName, ref m_AllObjectRefColumns, |
| | 752 | | Serializable.SerializableTypes.Object, |
| | 753 | | insertAtColumnIdentifier); |
| | 754 | | case Serializable.SerializableTypes.EnumInt: |
| 3 | 755 | | return AddColumnInternal(columnName, ref m_AllEnumIntColumns, |
| | 756 | | Serializable.SerializableTypes.EnumInt, |
| | 757 | | insertAtColumnIdentifier); |
| | 758 | | } |
| | 759 | |
|
| 0 | 760 | | return -1; |
| 114 | 761 | | } |
| | 762 | |
|
| | 763 | | /// <inheritdoc /> |
| | 764 | | public override void RemoveColumn(Serializable.SerializableTypes columnType, int columnIdentifier) |
| 4 | 765 | | { |
| 4 | 766 | | switch (columnType) |
| | 767 | | { |
| | 768 | | case Serializable.SerializableTypes.String: |
| 1 | 769 | | RemoveColumnInternal(ref m_AllStringColumns, Serializable.SerializableTypes.String, |
| | 770 | | columnIdentifier); |
| 1 | 771 | | break; |
| | 772 | | case Serializable.SerializableTypes.Char: |
| 0 | 773 | | RemoveColumnInternal(ref m_AllCharColumns, Serializable.SerializableTypes.Char, columnIdentifier); |
| 0 | 774 | | break; |
| | 775 | | case Serializable.SerializableTypes.Bool: |
| 0 | 776 | | RemoveColumnInternal(ref m_AllBoolColumns, Serializable.SerializableTypes.Bool, columnIdentifier); |
| 0 | 777 | | break; |
| | 778 | | case Serializable.SerializableTypes.SByte: |
| 0 | 779 | | RemoveColumnInternal(ref m_AllSByteColumns, Serializable.SerializableTypes.SByte, columnIdentifier); |
| 0 | 780 | | break; |
| | 781 | | case Serializable.SerializableTypes.Byte: |
| 0 | 782 | | RemoveColumnInternal(ref m_AllByteColumns, Serializable.SerializableTypes.Byte, columnIdentifier); |
| 0 | 783 | | break; |
| | 784 | | case Serializable.SerializableTypes.Short: |
| 0 | 785 | | RemoveColumnInternal(ref m_AllShortColumns, Serializable.SerializableTypes.Short, columnIdentifier); |
| 0 | 786 | | break; |
| | 787 | | case Serializable.SerializableTypes.UShort: |
| 0 | 788 | | RemoveColumnInternal(ref m_AllUShortColumns, Serializable.SerializableTypes.UShort, |
| | 789 | | columnIdentifier); |
| 0 | 790 | | break; |
| | 791 | | case Serializable.SerializableTypes.Int: |
| 0 | 792 | | RemoveColumnInternal(ref m_AllIntColumns, Serializable.SerializableTypes.Int, columnIdentifier); |
| 0 | 793 | | break; |
| | 794 | | case Serializable.SerializableTypes.UInt: |
| 0 | 795 | | RemoveColumnInternal(ref m_AllUIntColumns, Serializable.SerializableTypes.UInt, columnIdentifier); |
| 0 | 796 | | break; |
| | 797 | | case Serializable.SerializableTypes.Long: |
| 0 | 798 | | RemoveColumnInternal(ref m_AllLongColumns, Serializable.SerializableTypes.Long, columnIdentifier); |
| 0 | 799 | | break; |
| | 800 | | case Serializable.SerializableTypes.ULong: |
| 0 | 801 | | RemoveColumnInternal(ref m_AllULongColumns, Serializable.SerializableTypes.ULong, columnIdentifier); |
| 0 | 802 | | break; |
| | 803 | | case Serializable.SerializableTypes.Float: |
| 0 | 804 | | RemoveColumnInternal(ref m_AllFloatColumns, Serializable.SerializableTypes.Float, columnIdentifier); |
| 0 | 805 | | break; |
| | 806 | | case Serializable.SerializableTypes.Double: |
| 0 | 807 | | RemoveColumnInternal(ref m_AllDoubleColumns, Serializable.SerializableTypes.Double, |
| | 808 | | columnIdentifier); |
| 0 | 809 | | break; |
| | 810 | | case Serializable.SerializableTypes.Vector2: |
| 0 | 811 | | RemoveColumnInternal(ref m_AllVector2Columns, Serializable.SerializableTypes.Vector2, |
| | 812 | | columnIdentifier); |
| 0 | 813 | | break; |
| | 814 | | case Serializable.SerializableTypes.Vector3: |
| 0 | 815 | | RemoveColumnInternal(ref m_AllVector3Columns, Serializable.SerializableTypes.Vector3, |
| | 816 | | columnIdentifier); |
| 0 | 817 | | break; |
| | 818 | | case Serializable.SerializableTypes.Vector4: |
| 0 | 819 | | RemoveColumnInternal(ref m_AllVector4Columns, Serializable.SerializableTypes.Vector4, |
| | 820 | | columnIdentifier); |
| 0 | 821 | | break; |
| | 822 | | case Serializable.SerializableTypes.Vector2Int: |
| 0 | 823 | | RemoveColumnInternal(ref m_AllVector2IntColumns, Serializable.SerializableTypes.Vector2Int, |
| | 824 | | columnIdentifier); |
| 0 | 825 | | break; |
| | 826 | | case Serializable.SerializableTypes.Vector3Int: |
| 0 | 827 | | RemoveColumnInternal(ref m_AllVector3IntColumns, Serializable.SerializableTypes.Vector3Int, |
| | 828 | | columnIdentifier); |
| 0 | 829 | | break; |
| | 830 | | case Serializable.SerializableTypes.Quaternion: |
| 0 | 831 | | RemoveColumnInternal(ref m_AllQuaternionColumns, Serializable.SerializableTypes.Quaternion, |
| | 832 | | columnIdentifier); |
| 0 | 833 | | break; |
| | 834 | | case Serializable.SerializableTypes.Rect: |
| 0 | 835 | | RemoveColumnInternal(ref m_AllRectColumns, Serializable.SerializableTypes.Rect, columnIdentifier); |
| 0 | 836 | | break; |
| | 837 | | case Serializable.SerializableTypes.RectInt: |
| 0 | 838 | | RemoveColumnInternal(ref m_AllRectIntColumns, Serializable.SerializableTypes.RectInt, |
| | 839 | | columnIdentifier); |
| 0 | 840 | | break; |
| | 841 | | case Serializable.SerializableTypes.Color: |
| 0 | 842 | | RemoveColumnInternal(ref m_AllColorColumns, Serializable.SerializableTypes.Color, columnIdentifier); |
| 0 | 843 | | break; |
| | 844 | | case Serializable.SerializableTypes.LayerMask: |
| 0 | 845 | | RemoveColumnInternal(ref m_AllLayerMaskColumns, Serializable.SerializableTypes.LayerMask, |
| | 846 | | columnIdentifier); |
| 0 | 847 | | break; |
| | 848 | | case Serializable.SerializableTypes.Bounds: |
| 3 | 849 | | RemoveColumnInternal(ref m_AllBoundsColumns, Serializable.SerializableTypes.Bounds, |
| | 850 | | columnIdentifier); |
| 3 | 851 | | break; |
| | 852 | | case Serializable.SerializableTypes.BoundsInt: |
| 0 | 853 | | RemoveColumnInternal(ref m_AllBoundsIntColumns, Serializable.SerializableTypes.BoundsInt, |
| | 854 | | columnIdentifier); |
| 0 | 855 | | break; |
| | 856 | | case Serializable.SerializableTypes.Hash128: |
| 0 | 857 | | RemoveColumnInternal(ref m_AllHash128Columns, Serializable.SerializableTypes.Hash128, |
| | 858 | | columnIdentifier); |
| 0 | 859 | | break; |
| | 860 | | case Serializable.SerializableTypes.Gradient: |
| 0 | 861 | | RemoveColumnInternal(ref m_AllGradientColumns, Serializable.SerializableTypes.Gradient, |
| | 862 | | columnIdentifier); |
| 0 | 863 | | break; |
| | 864 | | case Serializable.SerializableTypes.AnimationCurve: |
| 0 | 865 | | RemoveColumnInternal(ref m_AllAnimationCurveColumns, Serializable.SerializableTypes.AnimationCurve, |
| | 866 | | columnIdentifier); |
| 0 | 867 | | break; |
| | 868 | | case Serializable.SerializableTypes.Object: |
| 0 | 869 | | RemoveColumnInternal(ref m_AllObjectRefColumns, Serializable.SerializableTypes.Object, |
| | 870 | | columnIdentifier); |
| 0 | 871 | | break; |
| | 872 | | case Serializable.SerializableTypes.EnumInt: |
| 0 | 873 | | RemoveColumnInternal(ref m_AllEnumIntColumns, Serializable.SerializableTypes.EnumInt, |
| | 874 | | columnIdentifier); |
| 0 | 875 | | break; |
| | 876 | | } |
| 4 | 877 | | } |
| | 878 | |
|
| | 879 | | // Set |
| | 880 | | /// <inheritdoc /> |
| | 881 | | public override ulong SetString(int rowIdentifier, int columnIdentifier, string newValue) |
| 10 | 882 | | { |
| 10 | 883 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllStringColumns, newValue); |
| 10 | 884 | | } |
| | 885 | |
|
| | 886 | | /// <inheritdoc /> |
| | 887 | | public override ulong SetBool(int rowIdentifier, int columnIdentifier, bool newValue) |
| 10 | 888 | | { |
| 10 | 889 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllBoolColumns, newValue); |
| 10 | 890 | | } |
| | 891 | |
|
| | 892 | | /// <inheritdoc /> |
| | 893 | | public override ulong SetChar(int rowIdentifier, int columnIdentifier, char newValue) |
| 10 | 894 | | { |
| 10 | 895 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllCharColumns, newValue); |
| 10 | 896 | | } |
| | 897 | |
|
| | 898 | | /// <inheritdoc /> |
| | 899 | | public override ulong SetSByte(int rowIdentifier, int columnIdentifier, sbyte newValue) |
| 10 | 900 | | { |
| 10 | 901 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllSByteColumns, newValue); |
| 10 | 902 | | } |
| | 903 | |
|
| | 904 | | /// <inheritdoc /> |
| | 905 | | public override ulong SetByte(int rowIdentifier, int columnIdentifier, byte newValue) |
| 10 | 906 | | { |
| 10 | 907 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllByteColumns, newValue); |
| 10 | 908 | | } |
| | 909 | |
|
| | 910 | | /// <inheritdoc /> |
| | 911 | | public override ulong SetEnumInt(int rowIdentifier, int columnIdentifier, int newValue) |
| 0 | 912 | | { |
| 0 | 913 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllEnumIntColumns, newValue); |
| 0 | 914 | | } |
| | 915 | |
|
| | 916 | | /// <inheritdoc /> |
| | 917 | | public override ulong SetShort(int rowIdentifier, int columnIdentifier, short newValue) |
| 10 | 918 | | { |
| 10 | 919 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllShortColumns, newValue); |
| 10 | 920 | | } |
| | 921 | |
|
| | 922 | | /// <inheritdoc /> |
| | 923 | | public override ulong SetUShort(int rowIdentifier, int columnIdentifier, ushort newValue) |
| 10 | 924 | | { |
| 10 | 925 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllUShortColumns, newValue); |
| 10 | 926 | | } |
| | 927 | |
|
| | 928 | | /// <inheritdoc /> |
| | 929 | | public override ulong SetInt(int rowIdentifier, int columnIdentifier, int newValue) |
| 10 | 930 | | { |
| 10 | 931 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllIntColumns, newValue); |
| 10 | 932 | | } |
| | 933 | |
|
| | 934 | | /// <inheritdoc /> |
| | 935 | | public override ulong SetUInt(int rowIdentifier, int columnIdentifier, uint newValue) |
| 10 | 936 | | { |
| 10 | 937 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllUIntColumns, newValue); |
| 10 | 938 | | } |
| | 939 | |
|
| | 940 | | /// <inheritdoc /> |
| | 941 | | public override ulong SetLong(int rowIdentifier, int columnIdentifier, long newValue) |
| 10 | 942 | | { |
| 10 | 943 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllLongColumns, newValue); |
| 10 | 944 | | } |
| | 945 | |
|
| | 946 | | /// <inheritdoc /> |
| | 947 | | public override ulong SetULong(int rowIdentifier, int columnIdentifier, ulong newValue) |
| 10 | 948 | | { |
| 10 | 949 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllULongColumns, newValue); |
| 10 | 950 | | } |
| | 951 | |
|
| | 952 | | /// <inheritdoc /> |
| | 953 | | public override ulong SetFloat(int rowIdentifier, int columnIdentifier, float newValue) |
| 10 | 954 | | { |
| 10 | 955 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllFloatColumns, newValue); |
| 10 | 956 | | } |
| | 957 | |
|
| | 958 | | /// <inheritdoc /> |
| | 959 | | public override ulong SetDouble(int rowIdentifier, int columnIdentifier, double newValue) |
| 10 | 960 | | { |
| 10 | 961 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllDoubleColumns, newValue); |
| 10 | 962 | | } |
| | 963 | |
|
| | 964 | | /// <inheritdoc /> |
| | 965 | | public override ulong SetVector2(int rowIdentifier, int columnIdentifier, Vector2 newStruct) |
| 10 | 966 | | { |
| 10 | 967 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllVector2Columns, newStruct); |
| 10 | 968 | | } |
| | 969 | |
|
| | 970 | | /// <inheritdoc /> |
| | 971 | | public override ulong SetVector3(int rowIdentifier, int columnIdentifier, Vector3 newStruct) |
| 10 | 972 | | { |
| 10 | 973 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllVector3Columns, newStruct); |
| 10 | 974 | | } |
| | 975 | |
|
| | 976 | | /// <inheritdoc /> |
| | 977 | | public override ulong SetVector4(int rowIdentifier, int columnIdentifier, Vector4 newStruct) |
| 10 | 978 | | { |
| 10 | 979 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllVector4Columns, newStruct); |
| 10 | 980 | | } |
| | 981 | |
|
| | 982 | | /// <inheritdoc /> |
| | 983 | | public override ulong SetVector2Int(int rowIdentifier, int columnIdentifier, Vector2Int newStruct) |
| 10 | 984 | | { |
| 10 | 985 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllVector2IntColumns, newStruct); |
| 10 | 986 | | } |
| | 987 | |
|
| | 988 | | /// <inheritdoc /> |
| | 989 | | public override ulong SetVector3Int(int rowIdentifier, int columnIdentifier, Vector3Int newStruct) |
| 10 | 990 | | { |
| 10 | 991 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllVector3IntColumns, newStruct); |
| 10 | 992 | | } |
| | 993 | |
|
| | 994 | | /// <inheritdoc /> |
| | 995 | | public override ulong SetQuaternion(int rowIdentifier, int columnIdentifier, Quaternion newStruct) |
| 10 | 996 | | { |
| 10 | 997 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllQuaternionColumns, newStruct); |
| 10 | 998 | | } |
| | 999 | |
|
| | 1000 | | /// <inheritdoc /> |
| | 1001 | | public override ulong SetRect(int rowIdentifier, int columnIdentifier, Rect newStruct) |
| 10 | 1002 | | { |
| 10 | 1003 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllRectColumns, newStruct); |
| 10 | 1004 | | } |
| | 1005 | |
|
| | 1006 | | /// <inheritdoc /> |
| | 1007 | | public override ulong SetRectInt(int rowIdentifier, int columnIdentifier, RectInt newStruct) |
| 10 | 1008 | | { |
| 10 | 1009 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllRectIntColumns, newStruct); |
| 10 | 1010 | | } |
| | 1011 | |
|
| | 1012 | | /// <inheritdoc /> |
| | 1013 | | public override ulong SetColor(int rowIdentifier, int columnIdentifier, Color newStruct) |
| 10 | 1014 | | { |
| 10 | 1015 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllColorColumns, newStruct); |
| 10 | 1016 | | } |
| | 1017 | |
|
| | 1018 | | /// <inheritdoc /> |
| | 1019 | | public override ulong SetLayerMask(int rowIdentifier, int columnIdentifier, LayerMask newStruct) |
| 10 | 1020 | | { |
| 10 | 1021 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllLayerMaskColumns, newStruct); |
| 10 | 1022 | | } |
| | 1023 | |
|
| | 1024 | | /// <inheritdoc /> |
| | 1025 | | public override ulong SetBounds(int rowIdentifier, int columnIdentifier, Bounds newStruct) |
| 10 | 1026 | | { |
| 10 | 1027 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllBoundsColumns, newStruct); |
| 10 | 1028 | | } |
| | 1029 | |
|
| | 1030 | | /// <inheritdoc /> |
| | 1031 | | public override ulong SetBoundsInt(int rowIdentifier, int columnIdentifier, BoundsInt newStruct) |
| 10 | 1032 | | { |
| 10 | 1033 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllBoundsIntColumns, newStruct); |
| 10 | 1034 | | } |
| | 1035 | |
|
| | 1036 | | /// <inheritdoc /> |
| | 1037 | | public override ulong SetHash128(int rowIdentifier, int columnIdentifier, Hash128 newStruct) |
| 10 | 1038 | | { |
| 10 | 1039 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllHash128Columns, newStruct); |
| 10 | 1040 | | } |
| | 1041 | |
|
| | 1042 | | /// <inheritdoc /> |
| | 1043 | | public override ulong SetGradient(int rowIdentifier, int columnIdentifier, Gradient newObject) |
| 10 | 1044 | | { |
| 10 | 1045 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllGradientColumns, newObject); |
| 10 | 1046 | | } |
| | 1047 | |
|
| | 1048 | | /// <inheritdoc /> |
| | 1049 | | public override ulong SetAnimationCurve(int rowIdentifier, int columnIdentifier, AnimationCurve newObject) |
| 10 | 1050 | | { |
| 10 | 1051 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllAnimationCurveColumns, newObject); |
| 10 | 1052 | | } |
| | 1053 | |
|
| | 1054 | | /// <inheritdoc /> |
| | 1055 | | public override ulong SetObject(int rowIdentifier, int columnIdentifier, Object newObject) |
| 10 | 1056 | | { |
| 10 | 1057 | | return SetCell(rowIdentifier, columnIdentifier, ref m_AllObjectRefColumns, newObject); |
| 10 | 1058 | | } |
| | 1059 | |
|
| | 1060 | | /// <inheritdoc /> |
| | 1061 | | public override void SetTypeNameForColumn(int columnIdentifier, string assemblyQualifiedName) |
| 0 | 1062 | | { |
| 0 | 1063 | | ref ColumnEntry entry = ref m_ColumnIdentifierToDenseIndexMap[columnIdentifier]; |
| | 1064 | |
|
| 0 | 1065 | | if (entry.ColumnType == Serializable.SerializableTypes.Object) |
| 0 | 1066 | | { |
| 0 | 1067 | | m_AllObjectRefTypeNames[entry.ColumnDenseIndex] = assemblyQualifiedName; |
| 0 | 1068 | | } |
| 0 | 1069 | | else if (entry.ColumnType == Serializable.SerializableTypes.EnumInt) |
| 0 | 1070 | | { |
| 0 | 1071 | | m_AllEnumIntTypeNames[entry.ColumnDenseIndex] = assemblyQualifiedName; |
| 0 | 1072 | | } |
| | 1073 | | else |
| 0 | 1074 | | { |
| 0 | 1075 | | throw new NotSupportedException( |
| | 1076 | | "Type name overloads are only supported for types inheriting from UnityEngine.Object or from System. |
| | 1077 | | } |
| 0 | 1078 | | } |
| | 1079 | |
|
| | 1080 | | /// <inheritdoc /> |
| | 1081 | | public override string GetTypeNameForColumn(int columnIdentifier) |
| 0 | 1082 | | { |
| 0 | 1083 | | ref ColumnEntry entry = ref m_ColumnIdentifierToDenseIndexMap[columnIdentifier]; |
| 0 | 1084 | | int denseIndex = entry.ColumnDenseIndex; |
| | 1085 | |
|
| 0 | 1086 | | if (entry.ColumnType == Serializable.SerializableTypes.Object) |
| 0 | 1087 | | { |
| 0 | 1088 | | return m_AllObjectRefTypeNames[entry.ColumnDenseIndex]; |
| | 1089 | | } |
| | 1090 | |
|
| 0 | 1091 | | if (entry.ColumnType == Serializable.SerializableTypes.EnumInt) |
| 0 | 1092 | | { |
| 0 | 1093 | | return m_AllEnumIntTypeNames[entry.ColumnDenseIndex]; |
| | 1094 | | } |
| | 1095 | |
|
| 0 | 1096 | | throw new NotSupportedException( |
| | 1097 | | "Type name overloads are only supported for types inheriting from UnityEngine.Object or from System.Enum |
| 0 | 1098 | | } |
| | 1099 | |
|
| | 1100 | | // Get |
| | 1101 | | /// <inheritdoc /> |
| | 1102 | | public override string GetString(int rowIdentifier, int columnIdentifier) |
| 10 | 1103 | | { |
| 10 | 1104 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllStringColumns); |
| 10 | 1105 | | } |
| | 1106 | |
|
| | 1107 | | /// <inheritdoc /> |
| | 1108 | | public override bool GetBool(int rowIdentifier, int columnIdentifier) |
| 10 | 1109 | | { |
| 10 | 1110 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllBoolColumns); |
| 10 | 1111 | | } |
| | 1112 | |
|
| | 1113 | | /// <inheritdoc /> |
| | 1114 | | public override char GetChar(int rowIdentifier, int columnIdentifier) |
| 10 | 1115 | | { |
| 10 | 1116 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllCharColumns); |
| 10 | 1117 | | } |
| | 1118 | |
|
| | 1119 | | /// <inheritdoc /> |
| | 1120 | | public override int GetEnumInt(int rowIdentifier, int columnIdentifier) |
| 0 | 1121 | | { |
| 0 | 1122 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllEnumIntColumns); |
| 0 | 1123 | | } |
| | 1124 | |
|
| | 1125 | | /// <inheritdoc /> |
| | 1126 | | public override sbyte GetSByte(int rowIdentifier, int columnIdentifier) |
| 10 | 1127 | | { |
| 10 | 1128 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllSByteColumns); |
| 10 | 1129 | | } |
| | 1130 | |
|
| | 1131 | | /// <inheritdoc /> |
| | 1132 | | public override byte GetByte(int rowIdentifier, int columnIdentifier) |
| 10 | 1133 | | { |
| 10 | 1134 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllByteColumns); |
| 10 | 1135 | | } |
| | 1136 | |
|
| | 1137 | | /// <inheritdoc /> |
| | 1138 | | public override short GetShort(int rowIdentifier, int columnIdentifier) |
| 10 | 1139 | | { |
| 10 | 1140 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllShortColumns); |
| 10 | 1141 | | } |
| | 1142 | |
|
| | 1143 | | /// <inheritdoc /> |
| | 1144 | | public override ushort GetUShort(int rowIdentifier, int columnIdentifier) |
| 10 | 1145 | | { |
| 10 | 1146 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllUShortColumns); |
| 10 | 1147 | | } |
| | 1148 | |
|
| | 1149 | | /// <inheritdoc /> |
| | 1150 | | public override int GetInt(int rowIdentifier, int columnIdentifier) |
| 10 | 1151 | | { |
| 10 | 1152 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllIntColumns); |
| 10 | 1153 | | } |
| | 1154 | |
|
| | 1155 | | /// <inheritdoc /> |
| | 1156 | | public override uint GetUInt(int rowIdentifier, int columnIdentifier) |
| 10 | 1157 | | { |
| 10 | 1158 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllUIntColumns); |
| 10 | 1159 | | } |
| | 1160 | |
|
| | 1161 | | /// <inheritdoc /> |
| | 1162 | | public override long GetLong(int rowIdentifier, int columnIdentifier) |
| 10 | 1163 | | { |
| 10 | 1164 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllLongColumns); |
| 10 | 1165 | | } |
| | 1166 | |
|
| | 1167 | | /// <inheritdoc /> |
| | 1168 | | public override ulong GetULong(int rowIdentifier, int columnIdentifier) |
| 10 | 1169 | | { |
| 10 | 1170 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllULongColumns); |
| 10 | 1171 | | } |
| | 1172 | |
|
| | 1173 | | /// <inheritdoc /> |
| | 1174 | | public override float GetFloat(int rowIdentifier, int columnIdentifier) |
| 10 | 1175 | | { |
| 10 | 1176 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllFloatColumns); |
| 10 | 1177 | | } |
| | 1178 | |
|
| | 1179 | | /// <inheritdoc /> |
| | 1180 | | public override double GetDouble(int rowIdentifier, int columnIdentifier) |
| 10 | 1181 | | { |
| 10 | 1182 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllDoubleColumns); |
| 10 | 1183 | | } |
| | 1184 | |
|
| | 1185 | | /// <inheritdoc /> |
| | 1186 | | public override Vector2 GetVector2(int rowIdentifier, int columnIdentifier) |
| 10 | 1187 | | { |
| 10 | 1188 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllVector2Columns); |
| 10 | 1189 | | } |
| | 1190 | |
|
| | 1191 | | /// <inheritdoc /> |
| | 1192 | | public override Vector3 GetVector3(int rowIdentifier, int columnIdentifier) |
| 10 | 1193 | | { |
| 10 | 1194 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllVector3Columns); |
| 10 | 1195 | | } |
| | 1196 | |
|
| | 1197 | | /// <inheritdoc /> |
| | 1198 | | public override Vector4 GetVector4(int rowIdentifier, int columnIdentifier) |
| 10 | 1199 | | { |
| 10 | 1200 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllVector4Columns); |
| 10 | 1201 | | } |
| | 1202 | |
|
| | 1203 | | /// <inheritdoc /> |
| | 1204 | | public override Vector2Int GetVector2Int(int rowIdentifier, int columnIdentifier) |
| 10 | 1205 | | { |
| 10 | 1206 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllVector2IntColumns); |
| 10 | 1207 | | } |
| | 1208 | |
|
| | 1209 | | /// <inheritdoc /> |
| | 1210 | | public override Vector3Int GetVector3Int(int rowIdentifier, int columnIdentifier) |
| 10 | 1211 | | { |
| 10 | 1212 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllVector3IntColumns); |
| 10 | 1213 | | } |
| | 1214 | |
|
| | 1215 | | /// <inheritdoc /> |
| | 1216 | | public override Quaternion GetQuaternion(int rowIdentifier, int columnIdentifier) |
| 10 | 1217 | | { |
| 10 | 1218 | | return GetCell(rowIdentifier, columnIdentifier, ref m_AllQuaternionColumns); |
| 10 | 1219 | | } |
| | 1220 | |
|
| | 1221 | | /// <inheritdoc /> |
|