204 return absl::FailedPreconditionError(
"ROM not loaded");
209 return absl::FailedPreconditionError(
"No resource label manager");
212 if (!label_mgr->labels_loaded_) {
213 return absl::FailedPreconditionError(
"No labels file loaded");
216 std::map<std::string, std::string> result;
218 auto it = label_mgr->labels_.find(category);
219 if (it != label_mgr->labels_.end()) {
220 for (
const auto& [key, value] : it->second) {
230 return absl::InvalidArgumentError(
"ROM not loaded");
234 if (!label_mgr || !label_mgr->labels_loaded_) {
235 return absl::InvalidArgumentError(
"No labels file loaded");
238 std::ostringstream json;
241 bool first_category =
true;
242 for (
const auto& [category, labels] : label_mgr->labels_) {
243 if (!first_category) json <<
",\n";
244 first_category =
false;
246 json <<
" \"" << category <<
"\": {\n";
248 bool first_label =
true;
249 for (
const auto& [key, value] : labels) {
250 if (!first_label) json <<
",\n";
253 json <<
" \"" << key <<
"\": \"" << value <<
"\"";
std::string ExtractSpriteLabels()
Extract sprite labels.
absl::StatusOr< std::string > ExportToJson()
Export all labels to JSON format.
std::string GetCommonTile16Reference()
Add common tile16 reference for AI.
std::string ExtractDungeonLabels()
Extract dungeon labels.
std::string ExtractRoomLabels()
Extract room labels.
absl::StatusOr< std::string > BuildResourceContext()
Build a complete resource context string for AI prompts.
std::string ExtractOverworldLabels()
Extract overworld map labels.
absl::StatusOr< std::map< std::string, std::string > > GetLabels(const std::string &category)
Get labels for a specific resource category.
std::string ExtractEntranceLabels()
Extract entrance labels.