Пример #1
0
void CppiaVar::runInit(CppiaCtx *ctx)
{
   if (isStatic)
   {
      if (dynamicFunction)
         objVal = createMemberClosure(0,(ScriptCallable*)dynamicFunction->funExpr);
      else if (init)
         switch(exprType)
         {
            case etInt: intVal = init->runInt(ctx); break;
            case etFloat: floatVal = init->runFloat(ctx); break;
            case etString: stringVal = init->runString(ctx); break;
            case etObject: objVal = init->runObject(ctx); break;
            default: ;
         }
   }
}
Пример #2
0
void CppiaVar::runInit(CppiaCtx *ctx)
{
   if (isStatic)
   {
      if (dynamicFunction)
         objVal = createMemberClosure(0,(ScriptCallable*)dynamicFunction->funExpr);
      else if (init)
         switch(storeType)
         {
            case fsBool:
            case fsByte:
            case fsInt: intVal = init->runInt(ctx); break;
            case fsFloat: floatVal = init->runFloat(ctx); break;
            case fsString: stringVal = init->runString(ctx); break;
            case fsObject: objVal = init->runObject(ctx); break;
            case fsUnknown: ; // ?
         }
   }
}
Пример #3
0
void CppiaVar::createDynamic(hx::Object *inBase)
{
   *(hx::Object **)((char *)inBase+offset) = createMemberClosure(inBase,(ScriptCallable*)dynamicFunction->funExpr);
}