| 1447 | |
| 1448 | |
| 1449 | Dynamic CppiaClassInfo::setStaticValue(const String &inName,const Dynamic &inValue ,hx::PropertyAccess inCallProp) |
| 1450 | { |
| 1451 | if (inCallProp==paccDynamic) |
| 1452 | inCallProp = isNativeProperty(inName) ? paccAlways : paccNever; |
| 1453 | if (inCallProp) |
| 1454 | { |
| 1455 | ScriptCallable *setter = findStaticSetter(inName); |
| 1456 | if (setter) |
| 1457 | { |
| 1458 | Array<Dynamic> args = Array_obj<Dynamic>::__new(1,1); |
| 1459 | args[0] = inValue; |
| 1460 | return runFunExprDynamic(CppiaCtx::getCurrent(),setter,0, args); |
| 1461 | } |
| 1462 | } |
| 1463 | |
| 1464 | |
| 1465 | // Look for dynamic function (variable) |
| 1466 | for(int i=0;i<staticDynamicFunctions.size();i++) |
| 1467 | { |
| 1468 | if (cppia.strings[ staticDynamicFunctions[i]->nameId ]==inName) |
| 1469 | { |
| 1470 | CppiaVar *d = staticDynamicFunctions[i]; |
| 1471 | return d->setStaticValue(inValue); |
| 1472 | } |
| 1473 | } |
| 1474 | |
| 1475 | for(int i=0;i<staticVars.size();i++) |
| 1476 | { |
| 1477 | CppiaVar &var = *staticVars[i]; |
| 1478 | if (var.name==inName) |
| 1479 | { |
| 1480 | return var.setStaticValue(inValue); |
| 1481 | } |
| 1482 | } |
| 1483 | |
| 1484 | printf("Set static field not found (%s) %s\n", name.c_str(), inName.out_str()); |
| 1485 | return null(); |
| 1486 | |
| 1487 | } |
| 1488 | |
| 1489 | void CppiaClassInfo::GetInstanceFields(hx::Object *inObject, Array<String> &ioFields) |
| 1490 | { |
no test coverage detected