Editor-level service responsible for overworld entity mutations. More...
#include <entity_mutation_service.h>

Classes | |
| struct | MutationResult |
Public Member Functions | |
| EntityMutationService (zelda3::Overworld &overworld) | |
| MutationResult | InsertEntity (const std::string &type, ImVec2 pos, int map_id, int game_state) |
| Dispatches entity insertion based on type string. | |
| MutationResult | DeleteItem (const zelda3::OverworldItem &item_identity) |
| MutationResult | DeleteSprite (zelda3::Sprite *sprite, int game_state) |
| MutationResult | DeleteEntrance (zelda3::OverworldEntrance *entrance) |
| MutationResult | DeleteExit (zelda3::OverworldExit *exit) |
| MutationResult | DuplicateItem (const zelda3::OverworldItem &source, int offset_x, int offset_y) |
| zelda3::OverworldItem * | ResolveNextSelection (const zelda3::OverworldItem &anchor_identity) |
| Resolves the best next item to select after a deletion. | |
Private Attributes | |
| zelda3::Overworld & | overworld_ |
Editor-level service responsible for overworld entity mutations.
This service coordinates high-level entity changes (insertion, deletion, duplication) that involve both domain mutation and UI-related dispatch.
Definition at line 29 of file entity_mutation_service.h.
|
explicit |
Definition at line 11 of file entity_mutation_service.cc.
| EntityMutationService::MutationResult yaze::editor::EntityMutationService::InsertEntity | ( | const std::string & | type, |
| ImVec2 | pos, | ||
| int | map_id, | ||
| int | game_state ) |
Dispatches entity insertion based on type string.
Definition at line 14 of file entity_mutation_service.cc.
References yaze::editor::EntityMutationService::MutationResult::entity, yaze::editor::EntityMutationService::MutationResult::error_message, yaze::editor::InsertEntrance(), yaze::editor::InsertExit(), yaze::editor::InsertItem(), yaze::editor::InsertSprite(), overworld_, and yaze::editor::EntityMutationService::MutationResult::status.
Referenced by yaze::editor::OverworldEntityWorkbench::ProcessPendingInsertion().

| EntityMutationService::MutationResult yaze::editor::EntityMutationService::DeleteItem | ( | const zelda3::OverworldItem & | item_identity | ) |
Definition at line 85 of file entity_mutation_service.cc.
References yaze::editor::EntityMutationService::MutationResult::error_message, overworld_, yaze::editor::RemoveItemByIdentity(), and yaze::editor::EntityMutationService::MutationResult::status.

| EntityMutationService::MutationResult yaze::editor::EntityMutationService::DeleteSprite | ( | zelda3::Sprite * | sprite, |
| int | game_state ) |
Definition at line 96 of file entity_mutation_service.cc.
References yaze::zelda3::Overworld::mutable_sprites(), overworld_, and yaze::editor::EntityMutationService::MutationResult::status.

| EntityMutationService::MutationResult yaze::editor::EntityMutationService::DeleteEntrance | ( | zelda3::OverworldEntrance * | entrance | ) |
Definition at line 118 of file entity_mutation_service.cc.
References yaze::zelda3::OverworldEntrance::deleted, and yaze::editor::EntityMutationService::MutationResult::status.
| EntityMutationService::MutationResult yaze::editor::EntityMutationService::DeleteExit | ( | zelda3::OverworldExit * | exit | ) |
Definition at line 129 of file entity_mutation_service.cc.
References yaze::zelda3::OverworldExit::deleted_, and yaze::editor::EntityMutationService::MutationResult::status.
| EntityMutationService::MutationResult yaze::editor::EntityMutationService::DuplicateItem | ( | const zelda3::OverworldItem & | source, |
| int | offset_x, | ||
| int | offset_y ) |
Definition at line 70 of file entity_mutation_service.cc.
References yaze::editor::DuplicateItemByIdentity(), yaze::editor::EntityMutationService::MutationResult::entity, yaze::editor::EntityMutationService::MutationResult::error_message, overworld_, and yaze::editor::EntityMutationService::MutationResult::status.

| zelda3::OverworldItem * yaze::editor::EntityMutationService::ResolveNextSelection | ( | const zelda3::OverworldItem & | anchor_identity | ) |
Resolves the best next item to select after a deletion.
Definition at line 140 of file entity_mutation_service.cc.
References yaze::editor::FindNearestItemForSelection(), and overworld_.

|
private |
Definition at line 62 of file entity_mutation_service.h.
Referenced by DeleteItem(), DeleteSprite(), DuplicateItem(), InsertEntity(), and ResolveNextSelection().