Truxton artifact set object type

From truxwiki.com
Jump to navigation Jump to search

This records the type of Truxton object the artifact came from. This corresponds to the [ObjectTypeID] column of the [Entity] table.

Syntax

void truxton_artifact_set_object_type( uint64_t artifact_handle, uint32_t object_type );

Parameters

artifact_handle

The artifact instance. This handle comes from calling truxton_artifact_create().

object_type

The type of the object. It should be one of the defined constants, it will be stored in the [ObjectTypeID] column of the [Entity] table.

Sample

void create_artifact( char const * file_id, char const * media_id )
{
   uint64_t truxton = truxton_create();

   uint64_t artifact= truxton_artifact_create( truxton );

   truxton_artifact_set_file_id( artifact, file_id );
   truxton_artifact_set_media_id( artifact, media_id );
   truxton_artifact_set_object_id( artifact, file_id );
   truxton_artifact_set_object_type( artifact, OBJECT_TYPE_FILE );
   truxton_artifact_set_name( artifact, "Ducky Momo Server" );
   truxton_artifact_save( artifact );
   truxton_artifact_tag( artifact, "Too Young", "Yes, yes I am", 1 );

   char id[ 65 ];

   truxton_artifact_get_id( artifact, id, sizeof( id ) );

   printf( "Artifact ID is %s\n", id );

   truxton_artifact_destroy( artifact );
   truxton_destroy( truxton );
}