Advertisement

Handle assignment question

Started by February 19, 2011 11:47 PM
1 comment, last by Hardguy 14 years ago
I have some plain vanilla OBJ_REF classes that only have Factory, AddRef and Release methods in the them. When using these in script code I cannot do this:

cMyClass@ ob1 = cMyClass();
cMyClass@ obj2;
obj2 = obj1


but have to do:

@obj2 = obj1

I am guessing this needs to be doen to explicitly state that it is the handle that is to be copied, but I am not sure. Perhaps I am doing something terrible wrong? I tried looking in documentation but could find anything about it.
Your guess is right. Without the @ the assignment is a value assignment, which requires the opAssign method to work.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
Good to know I was on the right track! :)

This topic is closed to new replies.

Advertisement