#ifndef __TYPE_H__
#define __TYPE_H__

#include "mecha.h"

#include "serializationinfo.h"

#define DEREFERENCE_TYPE(__type,__y)    ((__type *) *((__type **) __y))

// -aleigh
// typedef __typeof__ (bool (*) (void *, SerializationInfo *)) SerializeDelegate;
// typedef __typeof__ (bool (*) (void *, SerializationInfo *)) DeserializeDelegate;

typedef bool (*SerializeDelegate)(void *, SerializationInfo *);
typedef bool (*DeserializeDelegate)(void *, SerializationInfo *);

typedef struct s_Type Type;

struct s_Type
{
    const char *name;
    SerializeDelegate   serialize;
    DeserializeDelegate deserialize;
};

#endif
