Type question

Previous topic - Next topic

monono

Maybe a stupid question, but types still make me wonder from time to time:
I have a type TY1 as SUPERTYPE. If go on, fill it with stuff and then make another instance of the same type TY2 as SUPERTYPE and say TY2 = TY1, than TY2 is a copy of TY1 . But I just want it to be a handle to TY1. I wonder cause I want to store a  typehandle of a parent object in another type and I do not use a typearray so I could just store the index. If I go for the typearray it´s an easy thing, but I want an absolut handle which doesn´t change when I delete an object from the array. Is it possible?

MrTAToad

The only way of doing handles (or rather pointers) to a TYPE would be to design a class in C++ and use new to allocate memory for it.

monono

Thx!
Sad thing. There were so many things to do with that pointers.

Kitty Hello

index is the way to go. If you got a handle and DIMPUSH on the array, the handle will likely point to garbage, because of memory allocations.

monono

Yes Kitty. I was quiet sure about it. I just saw the 2d entity system of schranz0r in the other thread, and thought that it maybe has changed with the v8 release. Indexing works fine, just doesn´t look that nice (the code).