For the prototype I am using a simple language with DX wrapping functionality purely for the prototyping speed it offers. The language itself offers the following which I consider to be useful to the problem in question:
- Struct-like declarations (Arrays not allowed inside structs)
- Multi-dimensional arrays
- Array and function pointers
I don't wish to store everything in a struct array as updating entities would be cumbersome, and it does not allow for much flexibility regarding what data can be stored. Similarly. Really, I would like each entity type to have its own individual struct, but would like a uniform method for accessing data from any entity type.
What I had in mind was a set of functions like:
- newGroup( groupName )
- newAssetInGroup( assetName, groupId )
- getAssetsInGroup( groupId )
- getAssetByName( assetName )
- getAssetById( assetId )
- getAssetAttribute( attributeId )
- getAssetGroup( assetId )
- removeAsset( assetId)
Matrix1Util_29
This plug-in provides various useful utilities for manipulating arrays and their contents, plus low-level access to those arrays.
Array Information
ARRAY COUNT
GET ARRAY COUNT
GET ARRAY DIMENSIONS
GET ARRAY INDEX
GET ARRAY ITEM SIZE
GET ARRAY SIZE
GET ARRAYPTR COUNT
GET ARRAYPTR DIMENSIONS
GET ARRAYPTR INDEX
GET ARRAYPTR ITEM SIZE
GET ARRAYPTR SIZE
GET ARRAYPTR TYPE
SET ARRAY INDEX
SET ARRAYPTR INDEX
Array Manipulation
CLEAR ARRAY
CLEAR ARRAY ITEM
CLEAR ARRAYPTR
CLEAR ARRAYPTR ITEM
ROTATE ARRAY
ROTATE ARRAYPTR
SWAP ARRAY ITEMS
SWAP ARRAYPTR ITEMS
Array Sorting
GET ARRAY SORT
GET ARRAYPTR SORT
REVERSE SORT ARRAY
REVERSE SORT ARRAY RANGE
REVERSE SORT ARRAYPTR
REVERSE SORT ARRAYPTR RANGE
SET ARRAY SORT
SET ARRAYPTR SORT
SORT ARRAY
SORT ARRAY RANGE
SORT ARRAYPTR
SORT ARRAYPTR RANGE
Pointers to arrays and array items
GET ARRAY ITEM PTR
GET ARRAYPTR
GET ARRAYPTR ITEM PTR
LINK ARRAY
UNDIM ARRAYPTR
UNLINK ARRAY
UDT Array format
GET ARRAY FIELD COUNT
GET ARRAY FIELD OFFSET
GET ARRAY FIELD TYPE
GET ARRAY FORMAT
GET ARRAYPTR FIELD COUNT
GET ARRAYPTR FIELD OFFSET
GET ARRAYPTR FIELD TYPE
GET ARRAYPTR FORMAT
GET FORMAT SIZE
Loading and Saving arrays
LOAD ARRAY FROM DATAFILE
LOAD ARRAYPTR FROM DATAFILE
SAVE ARRAY TO DATAFILE SAVE ARRAYPTR TO DATAFILE
Using these functions, is it possible to do what I have mentioned? Am I even heading in the right direction, or should I be thinking of some other system?
The problem I see is when you remove an asset. You don't want to just mark it as deleted and leave it there to go stale - especially if you need to do loop through a range of assets. If you delete the array index then you need to make sure you can still access all of the values after the one you just deleted.
I would really appreciate some pointers (no pun intended) on this and thank you all in advance.
Cheers,
Mike