8.30
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 存档中的角色。
|
||||
/// </summary>
|
||||
[System.Serializable]
|
||||
public struct CharacterSave
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色 ID,对应 CharacterConfig.Id。
|
||||
/// </summary>
|
||||
public int characterId;
|
||||
|
||||
/// <summary>
|
||||
/// 武器栏物品 ID,0 表示空栏。
|
||||
/// </summary>
|
||||
public int weaponItemId;
|
||||
|
||||
/// <summary>
|
||||
/// 防具栏物品 ID,0 表示空栏。
|
||||
/// </summary>
|
||||
public int armorItemId;
|
||||
|
||||
public CharacterSave(int characterId, int weaponItemId, int armorItemId)
|
||||
{
|
||||
this.characterId = characterId;
|
||||
this.weaponItemId = weaponItemId;
|
||||
this.armorItemId = armorItemId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 431023ff1288d45a9a8a3713cd38593e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 物品堆叠。
|
||||
/// </summary>
|
||||
[System.Serializable]
|
||||
public struct ItemStack
|
||||
{
|
||||
/// <summary>
|
||||
/// 物品 ID,对应 ItemConfig.Id。
|
||||
/// </summary>
|
||||
public int itemId;
|
||||
|
||||
/// <summary>
|
||||
/// 数量,不超过配表 ItemConfig.StackLimit。
|
||||
/// </summary>
|
||||
public int count;
|
||||
|
||||
public ItemStack(int itemId, int count)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
this.count = count;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48bca35b200a444218a36ce1a49a76ea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 战备配置。
|
||||
/// </summary>
|
||||
[System.Serializable]
|
||||
public sealed class LoadoutSave
|
||||
{
|
||||
/// <summary>
|
||||
/// 出战角色 ID 及顺序,1~4 人,顺序决定同速时的行动次序。
|
||||
/// </summary>
|
||||
public int[] partyCharacterIds;
|
||||
|
||||
/// <summary>
|
||||
/// 携带进入地图的物品,开局时填充共享背包;首版无局内效果。
|
||||
/// </summary>
|
||||
public List<ItemStack> carriedItems;
|
||||
|
||||
/// <summary>
|
||||
/// 本局难度,对应 DifficultyConfig 主键。
|
||||
/// </summary>
|
||||
public DifficultyTier difficultyId;
|
||||
|
||||
/// <summary>
|
||||
/// 补齐缺失字段,避免反序列化后出现空引用。
|
||||
/// </summary>
|
||||
public void Normalize()
|
||||
{
|
||||
if (partyCharacterIds == null)
|
||||
{
|
||||
partyCharacterIds = System.Array.Empty<int>();
|
||||
}
|
||||
|
||||
if (carriedItems == null)
|
||||
{
|
||||
carriedItems = new List<ItemStack>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb9f7c288b0da4b88b83e82c87418550
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 已结束单局的结算记录。
|
||||
/// </summary>
|
||||
[System.Serializable]
|
||||
public struct RunRecord
|
||||
{
|
||||
/// <summary>
|
||||
/// 结算结果。
|
||||
/// </summary>
|
||||
public RunResultType outcome;
|
||||
|
||||
/// <summary>
|
||||
/// 本局难度。
|
||||
/// </summary>
|
||||
public DifficultyTier difficultyId;
|
||||
|
||||
/// <summary>
|
||||
/// 本局使用的随机数。
|
||||
/// </summary>
|
||||
public long seed;
|
||||
|
||||
/// <summary>
|
||||
/// 进入单局时间,Unix 毫秒。
|
||||
/// </summary>
|
||||
public long startedAt;
|
||||
|
||||
/// <summary>
|
||||
/// 结算时间,Unix 毫秒。
|
||||
/// </summary>
|
||||
public long endedAt;
|
||||
|
||||
public RunRecord(RunResultType outcome, DifficultyTier difficultyId, long seed, long startedAt, long endedAt)
|
||||
{
|
||||
this.outcome = outcome;
|
||||
this.difficultyId = difficultyId;
|
||||
this.seed = seed;
|
||||
this.startedAt = startedAt;
|
||||
this.endedAt = endedAt;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 591a205ef9e5c4f5f9fadcbc5b0db979
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,104 @@
|
||||
using System.Collections.Generic;
|
||||
using GameFramework;
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏存档根数据。
|
||||
/// 对应 Docs/Tech/02_SaveData.md。
|
||||
/// </summary>
|
||||
[System.Serializable]
|
||||
public sealed class SaveData
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前存档结构版本。
|
||||
/// </summary>
|
||||
public const int CurrentVersion = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 存档结构版本。
|
||||
/// </summary>
|
||||
public int version = CurrentVersion;
|
||||
|
||||
/// <summary>
|
||||
/// 最后写入时间,Unix 毫秒。
|
||||
/// </summary>
|
||||
public long updatedAt;
|
||||
|
||||
/// <summary>
|
||||
/// 主仓库内容,无容量上限。
|
||||
/// </summary>
|
||||
public List<ItemStack> mainWarehouse;
|
||||
|
||||
/// <summary>
|
||||
/// 拥有的角色,数组顺序即入队顺序。
|
||||
/// </summary>
|
||||
public List<CharacterSave> characters;
|
||||
|
||||
/// <summary>
|
||||
/// 当前战备配置。
|
||||
/// </summary>
|
||||
public LoadoutSave loadout;
|
||||
|
||||
/// <summary>
|
||||
/// 已结束单局的结算记录。
|
||||
/// </summary>
|
||||
public List<RunRecord> runHistory;
|
||||
|
||||
/// <summary>
|
||||
/// 序列化为 JSON 字符串。
|
||||
/// </summary>
|
||||
public string ToJson()
|
||||
{
|
||||
return GameFramework.Utility.Json.ToJson(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从 JSON 字符串反序列化;json 为空或反序列化失败时返回 null。
|
||||
/// </summary>
|
||||
public static SaveData FromJson(string json)
|
||||
{
|
||||
if (string.IsNullOrEmpty(json))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
SaveData saveData = GameFramework.Utility.Json.ToObject<SaveData>(json);
|
||||
if (saveData == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
saveData.Normalize();
|
||||
return saveData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 补齐缺失字段,避免反序列化后出现空引用。
|
||||
/// </summary>
|
||||
private void Normalize()
|
||||
{
|
||||
if (mainWarehouse == null)
|
||||
{
|
||||
mainWarehouse = new List<ItemStack>();
|
||||
}
|
||||
|
||||
if (characters == null)
|
||||
{
|
||||
characters = new List<CharacterSave>();
|
||||
}
|
||||
|
||||
if (loadout == null)
|
||||
{
|
||||
loadout = new LoadoutSave();
|
||||
}
|
||||
|
||||
loadout.Normalize();
|
||||
|
||||
if (runHistory == null)
|
||||
{
|
||||
runHistory = new List<RunRecord>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2bfe2058edce460abc5e5054b5f7a7a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public enum SceneType : byte
|
||||
{
|
||||
Launch = 0,
|
||||
Menu = 1,
|
||||
Main = 2,
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20fc28f41ef04f8fa4fbfb9189b58d0d
|
||||
timeCreated: 1768899171
|
||||
@@ -1,30 +0,0 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 界面编号。
|
||||
/// </summary>
|
||||
public enum UIFormType : byte
|
||||
{
|
||||
Undefined = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 弹出框。
|
||||
/// </summary>
|
||||
DialogForm = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 主菜单。
|
||||
/// </summary>
|
||||
MenuForm = 100,
|
||||
|
||||
/// <summary>
|
||||
/// 设置。
|
||||
/// </summary>
|
||||
SettingForm = 101,
|
||||
|
||||
/// <summary>
|
||||
/// 关于。
|
||||
/// </summary>
|
||||
AboutForm = 102,
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -1,9 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2fc27161191c61549a74f80fd54e9645
|
||||
guid: ef320c3d6ef364abc8210ec6e2be2be6
|
||||
folderAsset: yes
|
||||
timeCreated: 1528026150
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4dccdfac7eea44c07b87a556527040b6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,34 @@
|
||||
using GameFramework;
|
||||
using GameFramework.Event;
|
||||
|
||||
namespace SepCore.Base
|
||||
{
|
||||
public class WarehouseSlotItemClickEventArgs : GameEventArgs
|
||||
{
|
||||
public static int EventId => typeof(WarehouseSlotItemClickEventArgs).GetHashCode();
|
||||
|
||||
public override int Id => EventId;
|
||||
|
||||
/// <summary>
|
||||
/// 被点击格子在整个固定网格中的索引,唯一对应一个格子。
|
||||
/// </summary>
|
||||
public int SlotId { get; private set; }
|
||||
|
||||
public WarehouseSlotItemClickEventArgs()
|
||||
{
|
||||
SlotId = 0;
|
||||
}
|
||||
|
||||
public static WarehouseSlotItemClickEventArgs Create(int slotId)
|
||||
{
|
||||
var args = ReferencePool.Acquire<WarehouseSlotItemClickEventArgs>();
|
||||
args.SlotId = slotId;
|
||||
return args;
|
||||
}
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
SlotId = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 196c6541cd4d447d6b951f3e8f06c083
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using Luban;
|
||||
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public sealed partial class FormatText : Luban.BeanBase
|
||||
{
|
||||
public FormatText(ByteBuf _buf)
|
||||
{
|
||||
Name = _buf.ReadString();
|
||||
Format = _buf.ReadString();
|
||||
}
|
||||
|
||||
public static FormatText DeserializeFormatText(ByteBuf _buf)
|
||||
{
|
||||
return new FormatText(_buf);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 文本名
|
||||
/// </summary>
|
||||
public readonly string Name;
|
||||
/// <summary>
|
||||
/// 格式化字符串
|
||||
/// </summary>
|
||||
public readonly string Format;
|
||||
|
||||
public const int __ID__ = -1977697820;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void ResolveRef(Tables tables)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "name:" + Name + ","
|
||||
+ "format:" + Format + ","
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c5b0b070e5621408e9aa0b909cab1f1b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -22,6 +22,7 @@ public sealed partial class GlobalConfig : Luban.BeanBase
|
||||
EnemyLoseTargetMs = _buf.ReadInt();
|
||||
EnemyFrontViewAngle = _buf.ReadInt();
|
||||
AlertMax = _buf.ReadInt();
|
||||
WarehouseSlotCount = _buf.ReadInt();
|
||||
BackpackSlotCount = _buf.ReadInt();
|
||||
SecureSlotCount = _buf.ReadInt();
|
||||
MinPlayerPartySize = _buf.ReadInt();
|
||||
@@ -67,6 +68,10 @@ public sealed partial class GlobalConfig : Luban.BeanBase
|
||||
/// </summary>
|
||||
public readonly int AlertMax;
|
||||
/// <summary>
|
||||
/// 仓库格子数
|
||||
/// </summary>
|
||||
public readonly int WarehouseSlotCount;
|
||||
/// <summary>
|
||||
/// 共享背包格子数
|
||||
/// </summary>
|
||||
public readonly int BackpackSlotCount;
|
||||
@@ -143,6 +148,7 @@ public sealed partial class GlobalConfig : Luban.BeanBase
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
@@ -154,6 +160,7 @@ public sealed partial class GlobalConfig : Luban.BeanBase
|
||||
+ "enemyLoseTargetMs:" + EnemyLoseTargetMs + ","
|
||||
+ "enemyFrontViewAngle:" + EnemyFrontViewAngle + ","
|
||||
+ "alertMax:" + AlertMax + ","
|
||||
+ "warehouseSlotCount:" + WarehouseSlotCount + ","
|
||||
+ "backpackSlotCount:" + BackpackSlotCount + ","
|
||||
+ "secureSlotCount:" + SecureSlotCount + ","
|
||||
+ "minPlayerPartySize:" + MinPlayerPartySize + ","
|
||||
|
||||
@@ -26,6 +26,7 @@ public sealed partial class ItemConfig : Luban.BeanBase
|
||||
MaxMpBonus = _buf.ReadInt();
|
||||
AtkBonus = _buf.ReadInt();
|
||||
MatBonus = _buf.ReadInt();
|
||||
SpeedBonus = _buf.ReadInt();
|
||||
}
|
||||
|
||||
public static ItemConfig DeserializeItemConfig(ByteBuf _buf)
|
||||
@@ -73,6 +74,10 @@ public sealed partial class ItemConfig : Luban.BeanBase
|
||||
/// MAT修正
|
||||
/// </summary>
|
||||
public readonly int MatBonus;
|
||||
/// <summary>
|
||||
/// SPD修正
|
||||
/// </summary>
|
||||
public readonly int SpeedBonus;
|
||||
|
||||
public const int __ID__ = -764023723;
|
||||
public override int GetTypeId() => __ID__;
|
||||
@@ -89,6 +94,7 @@ public sealed partial class ItemConfig : Luban.BeanBase
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
@@ -104,6 +110,7 @@ public sealed partial class ItemConfig : Luban.BeanBase
|
||||
+ "maxMpBonus:" + MaxMpBonus + ","
|
||||
+ "atkBonus:" + AtkBonus + ","
|
||||
+ "matBonus:" + MatBonus + ","
|
||||
+ "speedBonus:" + SpeedBonus + ","
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public sealed partial class SceneConfig : Luban.BeanBase
|
||||
{
|
||||
public SceneConfig(ByteBuf _buf)
|
||||
{
|
||||
Id = _buf.ReadInt();
|
||||
Id = (SceneType)_buf.ReadInt();
|
||||
AssetName = _buf.ReadString();
|
||||
BackgroundMusicId = _buf.ReadInt();
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public sealed partial class SceneConfig : Luban.BeanBase
|
||||
/// <summary>
|
||||
/// 场景编号
|
||||
/// </summary>
|
||||
public readonly int Id;
|
||||
public readonly SceneType Id;
|
||||
/// <summary>
|
||||
/// 资源名称
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 场景类型
|
||||
/// </summary>
|
||||
public enum SceneType : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// 启动场景
|
||||
/// </summary>
|
||||
Launch = 0,
|
||||
/// <summary>
|
||||
/// 菜单场景
|
||||
/// </summary>
|
||||
Menu = 1,
|
||||
/// <summary>
|
||||
/// 主场景
|
||||
/// </summary>
|
||||
Main = 2,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab1610b60f3ea4315a395afa38cc1ca5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -14,9 +14,10 @@ namespace SepCore.Definition
|
||||
public partial class Tables
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局固定规则
|
||||
/// 全局零散配置(单例)
|
||||
/// </summary>
|
||||
public TbGlobalConfig TbGlobalConfig {get; }
|
||||
public TbFormatText TbFormatText {get; }
|
||||
/// <summary>
|
||||
/// 稀有度搜索时间
|
||||
/// </summary>
|
||||
@@ -85,6 +86,7 @@ public partial class Tables
|
||||
public Tables(System.Func<string, ByteBuf> loader)
|
||||
{
|
||||
TbGlobalConfig = new TbGlobalConfig(loader("tbglobalconfig"));
|
||||
TbFormatText = new TbFormatText(loader("tbformattext"));
|
||||
TbRarityConfig = new TbRarityConfig(loader("tbrarityconfig"));
|
||||
TbDifficultyConfig = new TbDifficultyConfig(loader("tbdifficultyconfig"));
|
||||
TbCharacterConfig = new TbCharacterConfig(loader("tbcharacterconfig"));
|
||||
@@ -107,6 +109,7 @@ public partial class Tables
|
||||
private void ResolveRef()
|
||||
{
|
||||
TbGlobalConfig.ResolveRef(this);
|
||||
TbFormatText.ResolveRef(this);
|
||||
TbRarityConfig.ResolveRef(this);
|
||||
TbDifficultyConfig.ResolveRef(this);
|
||||
TbCharacterConfig.ResolveRef(this);
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using Luban;
|
||||
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public partial class TbFormatText
|
||||
{
|
||||
private readonly System.Collections.Generic.Dictionary<string, FormatText> _dataMap;
|
||||
private readonly System.Collections.Generic.List<FormatText> _dataList;
|
||||
|
||||
public TbFormatText(ByteBuf _buf)
|
||||
{
|
||||
_dataMap = new System.Collections.Generic.Dictionary<string, FormatText>();
|
||||
_dataList = new System.Collections.Generic.List<FormatText>();
|
||||
|
||||
for(int n = _buf.ReadSize() ; n > 0 ; --n)
|
||||
{
|
||||
FormatText _v;
|
||||
_v = FormatText.DeserializeFormatText(_buf);
|
||||
_dataList.Add(_v);
|
||||
_dataMap.Add(_v.Name, _v);
|
||||
}
|
||||
}
|
||||
|
||||
public System.Collections.Generic.Dictionary<string, FormatText> DataMap => _dataMap;
|
||||
public System.Collections.Generic.List<FormatText> DataList => _dataList;
|
||||
|
||||
public FormatText GetOrDefault(string key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public FormatText Get(string key) => _dataMap[key];
|
||||
public FormatText this[string key] => _dataMap[key];
|
||||
|
||||
public void ResolveRef(Tables tables)
|
||||
{
|
||||
foreach(var _v in _dataList)
|
||||
{
|
||||
_v.ResolveRef(tables);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d39bcaec55e074ab7a226678e837d3e9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -13,7 +13,7 @@ using Luban;
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局固定规则
|
||||
/// 全局零散配置(单例)
|
||||
/// </summary>
|
||||
public partial class TbGlobalConfig
|
||||
{
|
||||
@@ -55,6 +55,10 @@ public partial class TbGlobalConfig
|
||||
/// </summary>
|
||||
public int AlertMax => _data.AlertMax;
|
||||
/// <summary>
|
||||
/// 仓库格子数
|
||||
/// </summary>
|
||||
public int WarehouseSlotCount => _data.WarehouseSlotCount;
|
||||
/// <summary>
|
||||
/// 共享背包格子数
|
||||
/// </summary>
|
||||
public int BackpackSlotCount => _data.BackpackSlotCount;
|
||||
|
||||
@@ -17,12 +17,12 @@ namespace SepCore.Definition
|
||||
/// </summary>
|
||||
public partial class TbSceneConfig
|
||||
{
|
||||
private readonly System.Collections.Generic.Dictionary<int, SceneConfig> _dataMap;
|
||||
private readonly System.Collections.Generic.Dictionary<SceneType, SceneConfig> _dataMap;
|
||||
private readonly System.Collections.Generic.List<SceneConfig> _dataList;
|
||||
|
||||
public TbSceneConfig(ByteBuf _buf)
|
||||
{
|
||||
_dataMap = new System.Collections.Generic.Dictionary<int, SceneConfig>();
|
||||
_dataMap = new System.Collections.Generic.Dictionary<SceneType, SceneConfig>();
|
||||
_dataList = new System.Collections.Generic.List<SceneConfig>();
|
||||
|
||||
for(int n = _buf.ReadSize() ; n > 0 ; --n)
|
||||
@@ -34,12 +34,12 @@ public partial class TbSceneConfig
|
||||
}
|
||||
}
|
||||
|
||||
public System.Collections.Generic.Dictionary<int, SceneConfig> DataMap => _dataMap;
|
||||
public System.Collections.Generic.Dictionary<SceneType, SceneConfig> DataMap => _dataMap;
|
||||
public System.Collections.Generic.List<SceneConfig> DataList => _dataList;
|
||||
|
||||
public SceneConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public SceneConfig Get(int key) => _dataMap[key];
|
||||
public SceneConfig this[int key] => _dataMap[key];
|
||||
public SceneConfig GetOrDefault(SceneType key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public SceneConfig Get(SceneType key) => _dataMap[key];
|
||||
public SceneConfig this[SceneType key] => _dataMap[key];
|
||||
|
||||
public void ResolveRef(Tables tables)
|
||||
{
|
||||
|
||||
@@ -17,12 +17,12 @@ namespace SepCore.Definition
|
||||
/// </summary>
|
||||
public partial class TbUIFormConfig
|
||||
{
|
||||
private readonly System.Collections.Generic.Dictionary<int, UIFormConfig> _dataMap;
|
||||
private readonly System.Collections.Generic.Dictionary<UIFormType, UIFormConfig> _dataMap;
|
||||
private readonly System.Collections.Generic.List<UIFormConfig> _dataList;
|
||||
|
||||
public TbUIFormConfig(ByteBuf _buf)
|
||||
{
|
||||
_dataMap = new System.Collections.Generic.Dictionary<int, UIFormConfig>();
|
||||
_dataMap = new System.Collections.Generic.Dictionary<UIFormType, UIFormConfig>();
|
||||
_dataList = new System.Collections.Generic.List<UIFormConfig>();
|
||||
|
||||
for(int n = _buf.ReadSize() ; n > 0 ; --n)
|
||||
@@ -34,12 +34,12 @@ public partial class TbUIFormConfig
|
||||
}
|
||||
}
|
||||
|
||||
public System.Collections.Generic.Dictionary<int, UIFormConfig> DataMap => _dataMap;
|
||||
public System.Collections.Generic.Dictionary<UIFormType, UIFormConfig> DataMap => _dataMap;
|
||||
public System.Collections.Generic.List<UIFormConfig> DataList => _dataList;
|
||||
|
||||
public UIFormConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public UIFormConfig Get(int key) => _dataMap[key];
|
||||
public UIFormConfig this[int key] => _dataMap[key];
|
||||
public UIFormConfig GetOrDefault(UIFormType key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public UIFormConfig Get(UIFormType key) => _dataMap[key];
|
||||
public UIFormConfig this[UIFormType key] => _dataMap[key];
|
||||
|
||||
public void ResolveRef(Tables tables)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ public sealed partial class UIFormConfig : Luban.BeanBase
|
||||
{
|
||||
public UIFormConfig(ByteBuf _buf)
|
||||
{
|
||||
Id = _buf.ReadInt();
|
||||
Id = (UIFormType)_buf.ReadInt();
|
||||
AssetName = _buf.ReadString();
|
||||
UIGroupName = _buf.ReadString();
|
||||
AllowMultiInstance = _buf.ReadBool();
|
||||
@@ -31,7 +31,7 @@ public sealed partial class UIFormConfig : Luban.BeanBase
|
||||
/// <summary>
|
||||
/// 界面编号
|
||||
/// </summary>
|
||||
public readonly int Id;
|
||||
public readonly UIFormType Id;
|
||||
/// <summary>
|
||||
/// 资源名称
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 界面类型
|
||||
/// </summary>
|
||||
public enum UIFormType : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// 未定义
|
||||
/// </summary>
|
||||
Undefined = 0,
|
||||
/// <summary>
|
||||
/// 弹出框
|
||||
/// </summary>
|
||||
DialogForm = 1,
|
||||
/// <summary>
|
||||
/// 大厅界面
|
||||
/// </summary>
|
||||
LobbyForm = 100,
|
||||
/// <summary>
|
||||
/// 设置
|
||||
/// </summary>
|
||||
SettingForm = 101,
|
||||
/// <summary>
|
||||
/// 关于
|
||||
/// </summary>
|
||||
AboutForm = 102,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,8 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 75fd10c7585513846ab25372be0590b7
|
||||
timeCreated: 1528026162
|
||||
licenseType: Pro
|
||||
guid: 1d9c04bb114b74ef4a6c4e0985d7b31a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
Reference in New Issue
Block a user