Skip to content

Commit

Permalink
objptrlist propsync
Browse files Browse the repository at this point in the history
  • Loading branch information
rjkiv committed Jun 1, 2024
1 parent 8f52d57 commit cd0d424
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions src/system/obj/PropSync_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,31 @@ template <class T> bool PropSync(ObjPtrList<T, class ObjectDir>& ptr, DataNode&
}
else {
ObjPtrList<T, class ObjectDir>::iterator it = ptr.begin();
for(int cnt = prop->Int(i++); cnt >= 0; cnt--) ++it;
for(int cnt = prop->Int(i++); cnt > 0; cnt--) ++it;
MILO_ASSERT(i == prop->Size(), 0x150);
if(op == kPropGet){
// return PropSync(*it, node, prop, i, kPropGet); // supposed to call the Object PropSync template on line 67 but it doesn't for whatever reason
}
else if(op == kPropSet){

}
else if(op == kPropRemove){

}
else if(op == kPropInsert){

switch(op){
case kPropGet:
return PropSync((T*&)(it), node, prop, i, kPropGet);
case kPropSet:
T* objToSet = 0;
if(PropSync(objToSet, node, prop, i, kPropSet)){
ptr.Set(it, objToSet);
return true;
}
else return false;
case kPropRemove:
ptr.erase(it);
return true;
case kPropInsert:
T* objToInsert = 0;
if(PropSync(objToInsert, node, prop, i, kPropSet)){
ptr.insert(it, objToInsert);
return true;
}
else return false;
default:
return false;
}
else return false;
}
}

Expand Down

0 comments on commit cd0d424

Please sign in to comment.