Files
zeling_v2/Assets/Scripts/Support/Platform/IPlatformService.cs
2026-05-12 15:34:08 +08:00

55 lines
3.0 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.
using System.Threading.Tasks;
namespace BaseGames.Platform
{
/// <summary>
/// 平台服务抽象接口(架构 16_SupportingModules §3
/// 解耦游戏逻辑与平台 SDKSteam / Console / Mobile
/// </summary>
public interface IPlatformService
{
// ── 初始化 / 生命周期 ──────────────────────────────────────────────────
bool IsInitialized { get; }
Task<bool> InitializeAsync();
/// <summary>每帧调用(由 PlatformBootstrap.Update 驱动),处理 SDK 回调。</summary>
void RunCallbacks();
void Shutdown();
// ── 成就 ──────────────────────────────────────────────────────────────
void UnlockAchievement(string achievementId);
void ClearAchievement(string achievementId);
Task<bool> 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<bool> CloudSaveAsync(string fileName, byte[] data);
Task<byte[]> CloudLoadAsync(string fileName);
// ── Rich Presence ─────────────────────────────────────────────────────
void SetRichPresence(string key, string value);
void ClearRichPresence();
// ── 排行榜 ────────────────────────────────────────────────────────────
void SubmitLeaderboardScore(string boardId, long score);
Task<LeaderboardEntry[]> 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;
}
}