typeof class=S;; typeof moves = [S r1];; /* liste de tous les mouvements des pions d'une partie donnee */ fun msg(titre, s)= _DLGMessageBox _channel nil titre s 0;; /*----------------------------------------------------*/ /* fonction appelee lors de l'evenement "in" */ /* appelle la fonction move cote client pour chaque element de la liste move */ fun make_moves(cli,o,l)= if l==nil then 0 else let l -> [move next] in let strextr move -> [elt pos] in let atoi hd elt -> num_game in if num_game != 0 then nil else (UsendCli this cli (ObUi o) "move" strbuild pos; make_moves cli o next;0);; /*----------------------------------------------------*/ fun cbcomm(ui,cli,action,param,o)= _DLGMessageBox _channel nil "cbcomm " "on y passe bien" 0; if !strcmp action "in" then ( _DLGMessageBox _channel nil "cbcomm action in : " "oki" 0; make_moves cli o moves;0) else 0;; fun activate(o,from,cli,action,param,reply)= if !strcmp action strcat (ObName o) ".move" then ( let strextr param -> [elt next] in let atoi hd elt -> num_game in if num_game != 0 then nil else ( UsendCli this nil (ObUi o) "move" strbuild next; set moves = param::moves; 0 )) else if !strcmp action strcat (ObName o) ".reset" then ( let strextr param -> [elt next] in let atoi hd elt -> num_game in if num_game != 0 then nil else ( set moves = nil; UsendCli this nil (ObUi o) "reset" nil; 0 )) else nil;; /*----------------------------------------------------*/ fun newOb(o)= ObRegisterAction o strcat (ObName o) ".move" @activate; ObRegisterAction o strcat (ObName o) ".reset" @activate; set moves = nil; UcbComm this ObUi o mkfun5 @cbcomm o; 0;; /*----------------------------------------------------*/ fun IniPlug(file)= set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @newOb nil; 0;;