This repository has been archived on 2024-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
2024-01-30 22:59:59 +00:00
|
|
|
#include <state.h>
|
|
|
|
#include <entity.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2024-01-30 23:58:11 +00:00
|
|
|
int main()
|
2024-01-30 22:59:59 +00:00
|
|
|
{
|
|
|
|
MtState *state = mt_initialize("Interface Test");;
|
|
|
|
MtEntity *entity = mt_summon(state);
|
|
|
|
MtEntity *looked_up_entity = mt_get_entity(state, entity->identifier);
|
|
|
|
|
|
|
|
if(entity != looked_up_entity)
|
2024-01-30 23:58:11 +00:00
|
|
|
{
|
|
|
|
printf("Failed looking up entity; the pointers don't match:\nOriginal: %p\nLooked Up: %p\nERROR!", (void *) entity, (void *) looked_up_entity);
|
|
|
|
mt_drop(entity);
|
|
|
|
mt_cleanup(state);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
puts("The entity which was looked up from the identifier does match the original. SUCCESS!");
|
2024-01-30 22:59:59 +00:00
|
|
|
mt_drop(entity);
|
|
|
|
mt_cleanup(state);
|
2024-01-30 23:58:11 +00:00
|
|
|
return 0;
|
|
|
|
}
|