コード例 #1
0
AdventureEngineEngine::AdventureEngineEngine(OSystem *syst) 
: Engine(syst) {
   _previousMouseCommand = 0;
   _expertSystemStalled = false;
  clipsEnv = CreateEnvironment();
  debug("AdventureEngineEngine::AdventureEngineEngine: Created CLIPS Environment");
  // Put your engine in a sane state, but do nothing big yet;
  // in particular, do not load data from files; rather, if you
  // need to do such things, do them from run().
  SetEnvironmentContext(clipsEnv, (void*)this);
  //for now I just want to see if this works
  EnvBatchStar(clipsEnv, "Run.clp");
  //TODO: Define default directories once we have a successful compile
  //TODO: Save engine context within the clips environment (pointer)
  //TODO: Add the ability to register applications from CLIPS with SCUMMVM

  // However this is the place to specify all default directories
  //const Common::FSNode gameDataDir(ConfMan.get("path"));
  //SearchMan.addSubDirectoryMatching(gameDataDir, "sound");

  // Here is the right place to set up the engine specific debug channels
  //DebugMan.addDebugChannel(kAdventureEngineDebugExample, "example", "this is just an example for a engine specific debug channel");
  //DebugMan.addDebugChannel(kAdventureEngineDebugExample2, "example2", "also an example");

  // Don't forget to register your random source
  _rnd = new Common::RandomSource("AdventureEngine");

  debug("AdventureEngineEngine::AdventureEngineEngine");
}
コード例 #2
0
ファイル: filecom.c プロジェクト: ricksladkey/CLIPS
globle int BatchStarCommand(
  void *theEnv)
  {
   char *fileName;

   if (EnvArgCountCheck(theEnv,"batch*",EXACTLY,1) == -1) return(FALSE);
   if ((fileName = GetFileName(theEnv,"batch*",1)) == NULL) return(FALSE);

   return(EnvBatchStar(theEnv,fileName));
  }
コード例 #3
0
ファイル: commline.c プロジェクト: guitarpoet/php-clips
void RerouteStdin(
  void *theEnv,
  int argc,
  char *argv[])
  {
   int i;
   int theSwitch = NO_SWITCH;

   /*======================================*/
   /* If there aren't enough arguments for */
   /* the -f argument, then return.        */
   /*======================================*/

   if (argc < 3)
     { return; }

   /*=====================================*/
   /* If argv was not passed then return. */
   /*=====================================*/

   if (argv == NULL) return;

   /*=============================================*/
   /* Process each of the command line arguments. */
   /*=============================================*/

   for (i = 1 ; i < argc ; i++)
     {
      if (strcmp(argv[i],"-f") == 0) theSwitch = BATCH_SWITCH;
#if ! RUN_TIME
      else if (strcmp(argv[i],"-f2") == 0) theSwitch = BATCH_STAR_SWITCH;
      else if (strcmp(argv[i],"-l") == 0) theSwitch = LOAD_SWITCH;
#endif
      else if (theSwitch == NO_SWITCH)
        {
         PrintErrorID(theEnv,"SYSDEP",2,false);
         EnvPrintRouter(theEnv,WERROR,"Invalid option\n");
        }

      if (i > (argc-1))
        {
         PrintErrorID(theEnv,"SYSDEP",1,false);
         EnvPrintRouter(theEnv,WERROR,"No file found for ");

         switch(theSwitch)
           {
            case BATCH_SWITCH:
               EnvPrintRouter(theEnv,WERROR,"-f");
               break;

            case BATCH_STAR_SWITCH:
               EnvPrintRouter(theEnv,WERROR,"-f2");
               break;

            case LOAD_SWITCH:
               EnvPrintRouter(theEnv,WERROR,"-l");
           }

         EnvPrintRouter(theEnv,WERROR," option\n");
         return;
        }

      switch(theSwitch)
        {
         case BATCH_SWITCH:
            OpenBatch(theEnv,argv[++i],true);
            break;

#if (! RUN_TIME) && (! BLOAD_ONLY)
         case BATCH_STAR_SWITCH:
            EnvBatchStar(theEnv,argv[++i]);
            break;

         case LOAD_SWITCH:
            EnvLoad(theEnv,argv[++i]);
            break;
#endif
        }
     }
  }