Module conversions

Source
Expand description

Private module for very tightly coupled database conversion methods. In general, these have many invariants that need to be maintained when they’re called–do not assume it’s safe to make these public!

Macros§

deserialize_body 🔒
Generates the code to deserialize a specific body variant from JSON

Structs§

ABILITY_MAP
ItemModelPair
MATERIAL_STATS_MANIFEST

Functions§

convert_active_abilities_from_database
convert_active_abilities_to_database
convert_body_from_database
convert_body_to_database_json
convert_character_from_database
convert_hardcore_from_database
convert_hardcore_to_database
convert_inventory_from_database_items
Properly-recursive items (currently modular weapons) occupy the same inventory slot as their parent. The caller is responsible for ensuring that inventory_items and loadout_items are topologically sorted (i.e. forall i, items[i].parent_container_item_id == x implies exists j < i satisfying items[j].item_id == x)
convert_items_to_database_items
Returns a vector that contains all item rows to upsert; parent is responsible for deleting items from the same owner that aren’t affirmatively kept by this.
convert_loadout_from_database_items
convert_overflow_items_from_database_items
convert_recipe_book_from_database_items
convert_skill_groups_from_database 🔒
convert_skill_groups_to_database
convert_skill_set_from_database
NOTE: This does not return an error on failure, since we can partially recover from some failures. Instead, it returns the error in the second return value; make sure to handle it if present!
convert_stats_from_database
convert_waypoint_from_database_json
convert_waypoint_to_database_json
get_item_from_asset 🔒
get_mutable_item 🔒