}
else {
if(type(temp) == OT_NULL) {
- SQClassMemeber m;
+ SQClassMember m;
m.val = val;
_members->NewSlot(key,SQObjectPtr((SQUserPointer)_methods.size()));
_methods.push_back(m);
}
return true;
}
- SQClassMemeber m;
+ SQClassMember m;
m.val = val;
_members->NewSlot(key,SQObjectPtr((SQInteger)_defaultvalues.size()));
_defaultvalues.push_back(m);
struct SQInstance;
-struct SQClassMemeber {
- SQClassMemeber(){}
- SQClassMemeber(const SQClassMemeber &o) {
+struct SQClassMember {
+ SQClassMember(){}
+ SQClassMember(const SQClassMember &o) {
val = o.val;
attrs = o.attrs;
}
SQObjectPtr attrs;
};
-typedef sqvector<SQClassMemeber> SQClassMemeberVec;
+typedef sqvector<SQClassMember> SQClassMemberVec;
struct SQClass : public CHAINABLE_OBJ
{
bool NewSlot(const SQObjectPtr &key,const SQObjectPtr &val);
bool Get(const SQObjectPtr &key,SQObjectPtr &val) {
if(_members->Get(key,val)) {
- val = (type(val) == OT_INTEGER?_defaultvalues[_integer(val)].val:_methods[(int)_userpointer(val)].val);
+ val = (type(val) == OT_INTEGER?_defaultvalues[_integer(val)].val:_methods[_integer(val)].val);
return true;
}
return false;
SQTable *_members;
//SQTable *_properties;
SQClass *_base;
- SQClassMemeberVec _defaultvalues;
- SQClassMemeberVec _methods;
+ SQClassMemberVec _defaultvalues;
+ SQClassMemberVec _methods;
SQObjectPtrVec _metamethods;
SQObjectPtr _attributes;
unsigned int _typetag;
~SQInstance();
bool Get(const SQObjectPtr &key,SQObjectPtr &val) {
if(_class->_members->Get(key,val)) {
- val = (type(val) == OT_INTEGER?_values[_integer(val)]:_class->_methods[(int)_userpointer(val)].val);
+ val = (type(val) == OT_INTEGER?_values[_integer(val)]:_class->_methods[_integer(val)].val);
return true;
}
return false;