/************************************************/
/* MUI-Mastermind                               */
/* Freeware                                     */
/* © 1998 Christian Hattemer                    */
/* email: chris@mail.riednet.wh.tu-darmstadt.de */
/* 08.09.98 10:16                               */
/************************************************/

#include <string.h>

/* Mastermind */
#include "GUI.h"
#include "Locale.h"

/* Functions */
APTR  ConstructFunc(REG(a0) struct Hook *hook, REG(a2) APTR Pool   , REG(a1) struct AusgabefeldNode *an);
void  DestructFunc (REG(a0) struct Hook *hook, REG(a2) APTR Pool   , REG(a1) struct AusgabefeldNode *an);
ULONG DisplayFunc  (REG(a0) struct Hook *hook, REG(a2) char **Array, REG(a1) struct AusgabefeldNode *an);

extern STRPTR AppStrings[];


APTR ConstructFunc(REG(a0) struct Hook *hook, REG(a2) APTR Pool, REG(a1) struct AusgabefeldNode *an)
{
   struct AusgabefeldNode *Neu;

   if (Neu = AllocPooled(Pool, sizeof(struct AusgabefeldNode)))
      memcpy(Neu, an, sizeof(struct AusgabefeldNode));

   return(Neu);
}

void DestructFunc(REG(a0) struct Hook *hook, REG(a2) APTR Pool, REG(a1) struct AusgabefeldNode *an)
{
   FreePooled(Pool, an, sizeof(struct AusgabefeldNode));
}

ULONG DisplayFunc(REG(a0) struct Hook *hook, REG(a2) char **Array, REG(a1) struct AusgabefeldNode *an)
{
   if(an)
      {
         *Array++ = an->Zug;
         *Array++ = an->Symbole;
         *Array   = an->Bewertung;
      }
   else
      {
         *Array++ = GetString(LBL_ZUG);
         *Array++ = GetString(LBL_LSYMBOLE);
         *Array   = GetString(LBL_BEWERTUNG);
      }

   return(0);
}

