Skip to content

Commit

Permalink
[add] (api) rename function to entity interface
Browse files Browse the repository at this point in the history
  • Loading branch information
begla committed Jun 9, 2024
1 parent f1945d3 commit 8043af1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions iolite_c_api/iolite_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2722,12 +2722,14 @@ struct io_entity_i // NOLINT

// Gets the name of the given entity.
const char* (*get_name)(io_ref_t entity);
// Gets the UUID of the given entity.
io_uuid_t (*get_uuid)(io_ref_t entity);

// Renames the given entity.
void (*rename)(io_ref_t entity, const char* name);
// Returns the linear memory containing all the names for all active entities.
io_name_t* (*get_name_memory)();

// Gets the UUID of the given entity.
io_uuid_t (*get_uuid)(io_ref_t entity);

// Finds the first entity with the given name.
io_ref_t (*find_first_entity_with_name)(const char* name);
// Finds the first entity with the given UUID.
Expand Down
5 changes: 5 additions & 0 deletions iolite_plugins/lua_plugin/init_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1933,6 +1933,11 @@ void script_init_state(sol::state& s)
// @param entity Ref The entity to check.
// @return string value The name of the given entity.
s["Entity"]["get_name"] = io_entity->get_name;
// @function rename
// @summary Renames the given entity.
// @param entity Ref The entity to rename.
// @param name string The new name of the entity.
s["Entity"]["rename"] = io_entity->rename;

// @function find_first_entity_with_name
// @summary Finds the first entity with the given name.
Expand Down

0 comments on commit 8043af1

Please sign in to comment.