Esempio n. 1
0
static QScriptValue js_centreView(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_EXACT(2);
	ARG_NUMBER(0);
	ARG_NUMBER(1);
	return QScriptValue();
}
Esempio n. 2
0
static QScriptValue js_safeDest(QScriptContext *context, QScriptEngine *)
{
	ARG_COUNT_EXACT(3);
	ARG_NUMBER(0);
	ARG_NUMBER(1);
	ARG_NUMBER(2);
	return QScriptValue(true);
}
Esempio n. 3
0
static QScriptValue js_setAssemblyPoint(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_EXACT(3);
	ARG_STRUCT(0);
	ARG_NUMBER(1);
	ARG_NUMBER(2);
	return QScriptValue(true);
}
Esempio n. 4
0
static QScriptValue js_droidCanReach(QScriptContext *context, QScriptEngine *)
{
	ARG_COUNT_EXACT(3);
	ARG_DROID(0);
	ARG_NUMBER(1);
	ARG_NUMBER(2);
	return QScriptValue(true);
}
Esempio n. 5
0
static QScriptValue js_addStructure(QScriptContext *context, QScriptEngine *)
{
	ARG_COUNT_EXACT(4);
	ARG_NUMBER(0);
	ARG_PLAYER(1);
	ARG_NUMBER(2);
	ARG_NUMBER(3);
	return QScriptValue(true);
}
Esempio n. 6
0
static QScriptValue js_orderDroidLoc(QScriptContext *context, QScriptEngine *)
{
	ARG_COUNT_EXACT(4);
	ARG_DROID(0);
	ARG_ORDER(1);
	ARG_NUMBER(2);
	ARG_NUMBER(3);
	return QScriptValue(true);
}
Esempio n. 7
0
static QScriptValue js_distBetweenTwoPoints(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_EXACT(4);
	ARG_NUMBER(0);
	ARG_NUMBER(1);
	ARG_NUMBER(2);
	ARG_NUMBER(3);
	return QScriptValue(10);
}
Esempio n. 8
0
static QScriptValue js_setScrollParams(QScriptContext *context, QScriptEngine *)
{
	ARG_COUNT_EXACT(4);
	ARG_NUMBER(0);
	ARG_NUMBER(1);
	ARG_NUMBER(2);
	ARG_NUMBER(3);
	return QScriptValue();
}
Esempio n. 9
0
static QScriptValue js_setNoGoArea(QScriptContext *context, QScriptEngine *)
{
	ARG_COUNT_EXACT(5);
	ARG_NUMBER(0);
	ARG_NUMBER(1);
	ARG_NUMBER(2);
	ARG_NUMBER(3);
	ARG_PLAYER(4);
	return QScriptValue(true);
}
Esempio n. 10
0
static QScriptValue js_groupAddArea(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_EXACT(5);
	ARG_NUMBER(0);
	ARG_NUMBER(1);
	ARG_NUMBER(2);
	ARG_NUMBER(3);
	ARG_NUMBER(4);
	return QScriptValue();
}
Esempio n. 11
0
static QScriptValue js_playSound(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_VAR(1, 4);
	ARG_STRING(0);
	if (context->argumentCount() != 1)
	{
		SCRIPT_ASSERT(context, context->argumentCount() == 4, "Arguments must be either 1 or 4");
		ARG_NUMBER(1);
		ARG_NUMBER(2);
		ARG_NUMBER(3);
	}
	return QScriptValue();
}
Esempio n. 12
0
static QScriptValue js_setDroidExperience(QScriptContext *context, QScriptEngine *)
{
	ARG_COUNT_EXACT(2);
	ARG_DROID(0);
	ARG_NUMBER(1);
	return QScriptValue();
}
Esempio n. 13
0
static QScriptValue js_groupAddDroid(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_EXACT(2);
	ARG_NUMBER(0);
	ARG_DROID(1);
	return QScriptValue();
}
Esempio n. 14
0
static QScriptValue js_setPower(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_VAR(1, 2);
	ARG_NUMBER(0);
	if (context->argumentCount() > 1)
	{
		ARG_PLAYER(1);
	}
	return QScriptValue();
}
Esempio n. 15
0
static QScriptValue js_enumGroup(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_EXACT(1);
	ARG_NUMBER(0);
	QScriptValue result = engine->newArray(3);
	for (int i = 0; i < 3; i++)
	{
		result.setProperty(i, convDroid(engine));
	}
	return result;
}
Esempio n. 16
0
static QScriptValue js_setStructureLimits(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_VAR(2, 3);
	ARG_STRING(0);
	ARG_NUMBER(1);
	if (context->argumentCount() > 2)
	{
		ARG_PLAYER(2);
	}
	return QScriptValue();
}
Esempio n. 17
0
/// Special scripting function that registers a object-specific timer event. Note: Functions must be passed
/// quoted, otherwise they will be inlined!
static QScriptValue js_queue(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_VAR(1, 3);
	ARG_STRING(0);
	if (context->argumentCount() > 1) ARG_NUMBER(1);
	if (context->argumentCount() == 3) ARG_OBJ(2);
	QString funcName = context->argument(0).toString();
	// TODO - check that a function by that name exists
	// TODO - object argument
	int player = engine->globalObject().property("me").toInt32();
	timerNode node(engine, funcName, player);
	timers.push_back(node);
	return QScriptValue();
}
Esempio n. 18
0
File: event.c Progetto: barak/lush
static at *test_event_sub(int arg_number, at **arg_array, int remove)
{
   /* Validate parameters */
   at *handler = NIL;
   if (arg_number == 0)
      handler = current_window_handler();
   else if (arg_number == 1)
      handler = APOINTER(1);
   else 
      ARG_NUMBER(-1);

   /* Perform */
   call_spoll();
   at *r = handler ? event_get(handler, remove) : event_peek();
   return r;
}
Esempio n. 19
0
static QScriptValue js_enumDroid(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_VAR(0, 3);
	switch (context->argumentCount())
	{
	default:
	case 3: ARG_PLAYER(2); // fall-through
	case 2: ARG_NUMBER(1); // fall-through
	case 1: ARG_PLAYER(0); break;
	}
	QScriptValue result = engine->newArray(3);
	for (int i = 0; i < 3; i++)
	{
		result.setProperty(i, convDroid(engine));
	}
	return result;
}
Esempio n. 20
0
File: interf.c Progetto: barak/lush
static at *
Nacces(int arg_number, at **arg_array, int champ)
{
  flt val = Fzero;
  int numero;
  
  ALL_ARGS_EVAL;
  if (arg_number <1 || arg_number >=3)
    ARG_NUMBER(-1);
  numero = AINTEGER(1);
  if (numero<0 || numero>=neurnombre)
    error(NIL,"illegal neuron number",NEW_NUMBER(numero));
  switch(arg_number) {
  case 1:
    val=get_Nfield(numero,champ);
    break;
  case 2:
    val = AFLT(2);
    set_Nfield(numero,champ,val);
    break;
  }
  return NEW_NUMBER(Ftofp(val));
}
Esempio n. 21
0
static QScriptValue js_groupSize(QScriptContext *context, QScriptEngine *)
{
	ARG_COUNT_EXACT(1);
	ARG_NUMBER(0);
	return QScriptValue(3);
}
Esempio n. 22
0
static QScriptValue js_setMissionTime(QScriptContext *context, QScriptEngine *)
{
	ARG_COUNT_EXACT(1);
	ARG_NUMBER(0);
	return QScriptValue();
}
Esempio n. 23
0
static QScriptValue js_setReinforcementTime(QScriptContext *context, QScriptEngine *)
{
	ARG_COUNT_EXACT(1);
	ARG_NUMBER(0);
	return QScriptValue();
}
Esempio n. 24
0
static QScriptValue js_objFromId(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_EXACT(1);
	ARG_NUMBER(0);
	return QScriptValue(convDroid(engine));
}
Esempio n. 25
0
static QScriptValue js_removeReticuleButton(QScriptContext *context, QScriptEngine *engine)
{
	ARG_COUNT_EXACT(1);
	ARG_NUMBER(0);
	return QScriptValue();
}