Exemplo n.º 1
0
/**
**	Register CCL features for players.
*/
global void PlayerCclRegister(void)
{
    gh_new_procedureN("player",CclPlayer);
    gh_new_procedure0_0("get-this-player",CclGetThisPlayer);
    gh_new_procedure1_0("set-this-player!",CclSetThisPlayer);

    gh_new_procedure1_0("set-all-players-food-unit-limit!",
		CclSetAllPlayersFoodUnitLimit);
    gh_new_procedure1_0("set-all-players-building-limit!",
		CclSetAllPlayersBuildingLimit);
    gh_new_procedure1_0("set-all-players-total-unit-limit!",
		CclSetAllPlayersTotalUnitLimit);

    gh_new_procedure3_0("set-diplomacy!",CclSetDiplomacy);
    gh_new_procedure2_0("diplomacy",CclDiplomacy);
    gh_new_procedure3_0("set-shared-vision!",CclSetSharedVision);
    gh_new_procedure2_0("shared-vision",CclSharedVision);

    gh_new_procedureN("define-race-wc-names",CclDefineRaceWcNames);

    gh_new_procedure0_0("new-colors",CclNewPlayerColors);

    // player member access functions
    gh_new_procedure1_0("get-player-resources",CclGetPlayerResources);
    gh_new_procedure2_0("set-player-resources!",CclSetPlayerResources);
}
Exemplo n.º 2
0
/**
**	Register CCL features for pathfinder.
*/
global void PathfinderCclRegister(void)
{
    gh_new_procedure0_0("a-star",CclAStar);
    gh_new_procedure0_0("no-a-star",CclNoAStar);
    gh_new_procedure1_0("a-star-fixed-unit-cost",CclAStarSetFixedUCC);
    gh_new_procedure1_0("a-star-moving-unit-cost",CclAStarSetMovingUCC);
    gh_new_procedure1_0 ("pf-show-regids!", CclPfHierShowRegIds);
    gh_new_procedure1_0 ("pf-show-groupids!", CclPfHierShowGroupIds);
}
Exemplo n.º 3
0
int
init_testing_framework ()
{
  JavaVM *jvm;
  JDK1_1InitArgs vm_args;

  vm_args.version = 0x00010001;
  JNI_GetDefaultJavaVMInitArgs (&vm_args);
  vm_args.classpath = getenv ("CLASSPATH");
  if (JNI_CreateJavaVM (&jvm, &env, &vm_args) < 0)
    return -1;

  test_class = (*env)->FindClass (env, "gnu/test/Test");
  if (test_class == NULL)
    {
      fprintf (stderr, "Unable to locate gnu.test.Test\n");
      return -1;
    }
  test_class = (*env)->NewGlobalRef (env, test_class);

  result_class = (*env)->FindClass (env, "gnu/test/Result");
  if (result_class == NULL)
    {
      fprintf (stderr, "Unable to locate gnu.test.Result\n");
      return -1;
    }
  result_class = (*env)->NewGlobalRef (env, result_class);

  test_mid = (*env)->GetMethodID (env, test_class, "test", 
				  "()Lgnu/test/Result;");
  test_name_mid = (*env)->GetMethodID (env, test_class, "getName", 
				       "()Ljava/lang/String;");
  if (test_mid == NULL || test_name_mid == NULL)
    {
      fprintf (stderr, "Malformed gnu.test.Test class\n");
      return -1;
    }

  result_name_mid = (*env)->GetMethodID (env, result_class, "getName", 
					 "()Ljava/lang/String;");
  result_msg_mid = (*env)->GetMethodID (env, result_class, "getMsg", 
					"()Ljava/lang/String;");
  if (result_name_mid == NULL || result_msg_mid == NULL)
    {
      fprintf (stderr, "Malformed gnu.test.Result class\n");
      return -1;
    }

  gh_new_procedure1_0 ("test", perform_test);
  return 0;
}
Exemplo n.º 4
0
/**
**	Called from scheme.
*/
local void gh_main_prog(int argc,char* argv[])
{
    gh_new_procedure0_0("clone-library-path",CclCloneLibraryPath);
    gh_new_procedure1_0("title-screen",CclTitleScreen);

    gh_new_procedure5_0("mana-sprite",CclManaSprite);
    gh_new_procedure5_0("health-sprite",CclHealthSprite);
    gh_new_procedure0_0("show-health-bar",CclShowHealthBar);
    gh_new_procedure0_0("show-health-dot",CclShowHealthDot);
    gh_new_procedure0_0("show-mana-bar",CclShowManaBar);
    gh_new_procedure0_0("show-mana-dot",CclShowManaDot);
    gh_new_procedure0_0("show-full",CclShowFull);
    gh_new_procedure0_0("show-no-full",CclShowNoFull);
    gh_new_procedure0_0("decoration-on-top",CclDecorationOnTop);
    gh_new_procedure0_0("show-sight-range",CclShowSightRange);
    gh_new_procedure0_0("show-react-range",CclShowReactRange);
    gh_new_procedure0_0("show-attack-range",CclShowAttackRange);
    gh_new_procedure0_0("show-orders",CclShowOrders);

    gh_new_procedure1_0("speed-mine",CclSpeedMine);
    gh_new_procedure1_0("speed-gold",CclSpeedGold);
    gh_new_procedure1_0("speed-chop",CclSpeedChop);
    gh_new_procedure1_0("speed-wood",CclSpeedWood);
    gh_new_procedure1_0("speed-haul",CclSpeedHaul);
    gh_new_procedure1_0("speed-oil",CclSpeedOil);
    gh_new_procedure1_0("speed-build",CclSpeedBuild);
    gh_new_procedure1_0("speed-train",CclSpeedTrain);
    gh_new_procedure1_0("speed-upgrade",CclSpeedUpgrade);
    gh_new_procedure1_0("speed-research",CclSpeedResearch);
    gh_new_procedure1_0("speeds",CclSpeeds);

    gh_new_procedureN("missile-type",CclMissileType);

    MapCclRegister();
    UnitButtonCclRegister();
    UnitTypeCclRegister();
    SoundCclRegister();
    UserInterfaceCclRegister();

    gh_new_procedure1_0("load-pud",CclLoadPud);
    gh_new_procedure2_0("define-map",CclDefineMap);

    gh_new_procedureN("clone-map",CclCloneMap);

    gh_new_procedure0_0("c-main1",CclMain1);

#ifdef GUILE_GTK
    SGTK_REGISTER_GLUE(sgtk_init_gtk_gtk_glue);
    SGTK_REGISTER_GLUE(sgtk_init_gtk_gdk_glue);
    // ALL Stupid
    {
    int argc;
    char** argv;
    static char* args[2] = { "clone", NULL };

    argc=1;
    argv=args;
    sgtk_init_with_args(&argc,&argv);
    }
    //sgtk_init_with_args(NULL,NULL);
#endif

    //
    //	Load and evaluate configuration file
    //
    CclInConfigFile=1;
    gh_eval_file(CclStartFile);
    CclInConfigFile=0;

    // FIXME: guile didn't cleanup, all memory is lost!

    main1(argc,argv);			// continue with setup
}