Files
zeling_v2/Assets/_Game/Scripts/World/Map/IMapService.cs
Joywayer f74d7f1877 Add independent review reports for Minimap system (Rounds 8, 9, and 26)
- Round 8 report highlights improvements in architecture, editor usability, and data robustness, with a total score of 80/100.
- Round 9 report focuses on editor extension capabilities, identifying issues with room data indexing and layout editing, resulting in a score of 76/100.
- Round 26 report evaluates the system against commercial standards, noting new issues and confirming previous fixes, with a score of 95.8/100.
2026-05-25 23:15:12 +08:00

59 lines
2.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Assets/Scripts/World/Map/IMapService.cs
// 地图服务接口,通过 ServiceLocator 注册与查询。
// MapManager 实现此接口MapPanel 等调用方通过接口解耦。
using System;
using System.Collections.Generic;
namespace BaseGames.World.Map
{
public interface IMapService
{
bool IsExplored(string roomId);
bool IsMapped(string roomId);
void SetMapped(string roomId);
/// <summary>
/// 批量解锁地图房间(地图碎片覆盖多间房间时调用)。
/// 内部去重,对每个新增房间触发 <see cref="OnRoomMapped"/>,最后只广播一次 EVT_MapUpdated。
/// </summary>
void SetMappedBatch(IEnumerable<string> roomIds);
MapDatabaseSO Database { get; }
/// <summary>玩家当前所在区域 ID最近一次 EVT_RegionChanged 对应的值)。</summary>
string CurrentRegionId { get; }
/// <summary>已踏入的房间总数。</summary>
int ExploredRoomCount { get; }
/// <summary>探索进度 0~1已探索房间数 / 数据库总房间数)。</summary>
float GetExplorationProgress();
/// <summary>返回属于指定区域的所有房间数据regionId 为空时返回空数组。</summary>
MapRoomDataSO[] GetRoomsByRegion(string regionId);
/// <summary>
/// 当地图数据库结构发生变化(房间增删/编辑器热改/运行时热更)时触发。
/// MapPanel、MinimapHUD 等 UI 应订阅此事件以执行完整重建。
/// </summary>
event Action OnDatabaseChanged;
/// <summary>
/// 探索进度变化事件(读档恢复 / 房间状态变化 / SetMapped 等)。
/// 与 <see cref="OnDatabaseChanged"/> 区分:本事件不要求 UI 销毁重建结构,
/// 仅需调用 RefreshAllCells/RebuildPins 等轻量刷新即可。
/// </summary>
event Action OnExplorationChanged;
/// <summary>
/// 某个房间首次被标记为 Mapped 时触发(参数为 roomId
/// UI 可订阅做"地图碎片解锁"动画。批量 SetMappedBatch 时对每个新增房间各触发一次。
/// </summary>
event Action<string> OnRoomMapped;
/// <summary>主动通知所有订阅者数据库结构已变更(同时会让 Database 的空间索引失效)。</summary>
void NotifyDatabaseChanged();
}
}