
#include <string.h>
#include "condacto.h"
#include "comun.h"

TipoCondacto condactos[NUMCONDACTOS]={
{"sinCondacto", condicion, nada,nada,aNada},
{"AT", condicion, locno, nada,aNada},
{"NOTAT",condicion, locno, nada,aNada},
{"ATGT",condicion, locno, nada,aNada},
{"ATLT",condicion, locno, nada,aNada},
{"PRESENT",condicion, objno, nada,aNada},
{"ABSENT",condicion, objno, nada,aNada},
{"WORN",condicion, objno, nada,aNada},
{"NOTWORN",condicion, objno, nada,aNada},
{"CARRIED",condicion, objno, nada,aNada},
{"NOTCARR",condicion, objno, nada,aNada},
{"CHANCE",condicion, percent, nada,aNada},
{"ZERO",condicion, flagno, nada,aNada},
{"NOTZERO",condicion, flagno, nada,aNada},
{"EQ",condicion, flagno, value,aNada},
{"GT",condicion, flagno, value,aNada},
{"LT",condicion, flagno, value,aNada},
{"ADJECT1",condicion, adjective, nada,aNada},
{"ADVERB",condicion, adverb, nada,aNada},
{"TIMEOUT",condicion,nada,nada,aNada},
{"ISAT",condicion,objno,locno_,aNada},
{"PREP",condicion,preposition, nada,aNada},
{"NOUN2",condicion,noun, nada,aNada},
{"ADJECT2",condicion, adjective, nada,aNada},
{"SAME",condicion, flagno, flagno,aNada},
{"NOTEQ",condicion,flagno, value,aNada},
{"NOTSAME",condicion,flagno, flagno,aNada},
{"ISNOTAT",condicion,objno,locno_,aNada},
{"INVEN", accion, nada, nada,aFinDeTabla},
{"DESC", accion, nada, nada,aDescribir},
{"QUIT", condicion, nada, nada,aNada},
{"END", accion, nada, nada,aEnd},
{"DONE", accion, nada, nada,aFinDeTabla},
{"OK", accion, nada, nada,aFinDeTabla},
{"ANYKEY", accion, nada, nada,aNada},
{"SAVE", accion, nada, nada,aDescribir},
{"LOAD", accion, nada, nada,aDescribir},
{"TURNS", accion, nada, nada,aNada},
{"SCORE", accion, nada, nada,aNada},
{"CLS", accion, nada, nada,aNada},
{"DROPALL", accion, nada, nada,aNada},
{"AUTOG", accion, nada, nada,aCondicional},
{"AUTOD", accion, nada, nada,aCondicional},
{"AUTOW", accion, nada, nada,aCondicional},
{"AUTOR", accion, nada, nada,aCondicional},
{"PAUSE", accion, value, nada,aNada},
{"GOTO", accion, locno, nada,aNada},
{"MESSAGE", accion, mesno, nada,aNada},
{"REMOVE", accion, objno, nada,aCondicional},
{"GET", accion, objno, nada,aCondicional},
{"DROP", accion, objno, nada,aCondicional},
{"WEAR", accion, objno, nada,aCondicional},
{"DESTROY", accion, objno, nada,aNada},
{"CREATE", accion, objno, nada,aNada},
{"SWAP", accion, objno, objno,aNada},
{"PLACE", accion, objno, locno_,aNada},
{"SET", accion, flagno, nada,aNada},
{"CLEAR", accion, flagno, nada,aNada},
{"PLUS", accion, flagno, value,aNada},
{"MINUS", accion, flagno, value,aNada},
{"LET", accion, flagno, value,aNada},
{"NEWLINE", accion, nada, nada,aNada},
{"PRINT", accion, flagno, nada,aNada},
{"SYSMESS", accion, smesno, nada,aNada},
{"COPYOF", accion, objno, flagno,aNada},
{"COPYOO", accion, objno, objno,aNada},
{"COPYFO", accion, flagno, objno,aNada},
{"COPYFF", accion, flagno, flagno,aNada},
{"LISTOBJ", accion, nada, nada,aNada},
{"RAMSAVE", accion, nada, nada,aNada},
{"RAMLOAD", accion, flagno, nada,aNada},
{"BELL", accion, nada, nada,aNada},
{"ADD", accion, flagno, flagno,aNada},
{"SUB", accion, flagno, flagno,aNada},
{"PARSE", condicion, nada, nada,aNada},
{"LISTAT", accion, locno_, nada,aNada},
{"PROCESS", accion, prono, nada,aNada},
{"MES", accion, mesno, nada,aNada},
{"MODE", accion, value, nada,aNada},
{"TIME", accion, value, value,aNada},
{"DOALL", accion, locno_, nada,aFinDeTabla},
{"PROMPT", accion, smesno, nada,aNada},
{"WEIGH", accion, objno, flagno,aNada},
{"PUTIN", accion, objno, locno, aCondicional},
{"TAKEOUT", accion, objno, locno ,aCondicional},
{"NEWTEXT", accion, nada, nada,aNada},
{"ABILITY", accion, value, value,aNada},
{"WEIGHT", accion, flagno, nada,aNada},
{"RANDOM", accion, flagno, nada,aNada},
{"WHATO", accion, nada, nada,aNada},
{"RESET", accion, locno, nada,aDescribir},
{"PUTO", accion, locno_, nada,aNada},
{"NOTDONE", accion, nada, nada,aFinDeTabla},
{"AUTOP", accion, locno, nada,aCondicional},
{"AUTOT", accion, locno, nada,aCondicional},
{"MOVE", condicion, flagno, nada,aNada},
/* los del spectrum */
{"EXTERN",accion,value,nada,aNada},
{"PAPER",accion,value,nada,aNada},
{"INK",accion,value,nada,aNada},
{"BORDER",accion,value,nada,aNada},
{"CHARSET",accion,value,nada,aNada},
{"LINE",accion,value,nada,aNada},
{"PICTURE",accion,locno,nada,aNada},
{"GRAPHIC",accion,value,nada,aNada},
{"INPUT",accion,value,nada,aNada},
{"SAVEAT",accion,nada,nada,aNada},
{"BACKAT",accion,nada,nada,aNada},
{"PRINTAT",accion,value,value,aNada},
{"PROTECT",accion,nada,nada,aNada},
{"BEEP",accion,value,value,aNada}
};

int BuscarCondacto(const char* nombre, TipoCondacto *condacto){
  int i;
  for(i=0;i<NUMCONDACTOS&&strcmp(nombre,condactos[i].nombre);i++);
  if(i==NUMCONDACTOS)
    return FALSE;
  condacto->tipo=condactos[i].tipo;
  condacto->tipoArg1=condactos[i].tipoArg1;
  condacto->tipoArg2=condactos[i].tipoArg2;
  return i;
};
