using System.Threading.Tasks;
namespace BaseGames.Platform
{
///
/// 平台服务抽象接口(架构 16_SupportingModules §3)。
/// 解耦游戏逻辑与平台 SDK(Steam / Console / Mobile)。
///
public interface IPlatformService
{
// ── 初始化 / 生命周期 ──────────────────────────────────────────────────
bool IsInitialized { get; }
Task InitializeAsync();
/// 每帧调用(由 PlatformBootstrap.Update 驱动),处理 SDK 回调。
void RunCallbacks();
void Shutdown();
// ── 成就 ──────────────────────────────────────────────────────────────
void UnlockAchievement(string achievementId);
void ClearAchievement(string achievementId);
Task IsAchievementUnlocked(string achievementId);
// ── 统计数据(Steam 成就进度跟踪)────────────────────────────────────
void SetStat(string statId, int value);
void IncrementStat(string statId, int increment = 1);
int GetStat(string statId);
// ── 云存档 ────────────────────────────────────────────────────────────
bool IsCloudAvailable { get; }
Task CloudSaveAsync(string fileName, byte[] data);
Task CloudLoadAsync(string fileName);
// ── Rich Presence ─────────────────────────────────────────────────────
void SetRichPresence(string key, string value);
void ClearRichPresence();
// ── 排行榜 ────────────────────────────────────────────────────────────
void SubmitLeaderboardScore(string boardId, long score);
Task GetLeaderboardEntries(string boardId, int maxCount);
// ── DLC / 商城 ────────────────────────────────────────────────────────
bool IsDLCOwned(string dlcId);
// ── 覆盖层(Steam Overlay 等)─────────────────────────────────────────
void ShowOverlay(string dialog);
}
public struct LeaderboardEntry
{
public string PlayerName;
public long Score;
public int Rank;
}
}