diff --git a/Config/Excel/Server/MachineConfig.xlsx b/Config/Excel/Server/MachineConfig.xlsx
deleted file mode 100644
index 195d88d..0000000
Binary files a/Config/Excel/Server/MachineConfig.xlsx and /dev/null differ
diff --git a/Config/Excel/Server/ProcessConfig.xlsx b/Config/Excel/Server/ProcessConfig.xlsx
deleted file mode 100644
index ae71a9b..0000000
Binary files a/Config/Excel/Server/ProcessConfig.xlsx and /dev/null differ
diff --git a/Config/Excel/Server/SceneConfig.xlsx b/Config/Excel/Server/SceneConfig.xlsx
deleted file mode 100644
index e2fbd61..0000000
Binary files a/Config/Excel/Server/SceneConfig.xlsx and /dev/null differ
diff --git a/Config/Excel/Server/WorldConfig.xlsx b/Config/Excel/Server/WorldConfig.xlsx
deleted file mode 100644
index 110e58a..0000000
Binary files a/Config/Excel/Server/WorldConfig.xlsx and /dev/null differ
diff --git a/Config/Excel/Server/~$MachineConfig.xlsx b/Config/Excel/Server/~$MachineConfig.xlsx
deleted file mode 100644
index fd5ec18..0000000
Binary files a/Config/Excel/Server/~$MachineConfig.xlsx and /dev/null differ
diff --git a/Config/Excel/Server/~$ProcessConfig.xlsx b/Config/Excel/Server/~$ProcessConfig.xlsx
deleted file mode 100644
index fd5ec18..0000000
Binary files a/Config/Excel/Server/~$ProcessConfig.xlsx and /dev/null differ
diff --git a/Config/Excel/Server/~$SceneConfig.xlsx b/Config/Excel/Server/~$SceneConfig.xlsx
deleted file mode 100644
index fd5ec18..0000000
Binary files a/Config/Excel/Server/~$SceneConfig.xlsx and /dev/null differ
diff --git a/Config/Excel/Server/~$WorldConfig.xlsx b/Config/Excel/Server/~$WorldConfig.xlsx
deleted file mode 100644
index fd5ec18..0000000
Binary files a/Config/Excel/Server/~$WorldConfig.xlsx and /dev/null differ
diff --git a/Config/Json/configs.json b/Config/Json/configs.json
new file mode 100644
index 0000000..eb4f787
--- /dev/null
+++ b/Config/Json/configs.json
@@ -0,0 +1,433 @@
+{
+ "WeightConfig": [
+ {
+ "Id": 100001,
+ "Model": "Weights/Weight2_5g",
+ "Type": 0,
+ "Weight": 3
+ }
+ ],
+ "RingConfig": [
+ {
+ "Id": 120001,
+ "Model": "rod_rings/rumoi/rumoi_oxiline_spin"
+ },
+ {
+ "Id": 120002,
+ "Model": "rod_rings/smt/smt_pure_ceramic_bolo"
+ }
+ ],
+ "LureConfig": [
+ {
+ "Id": 80001,
+ "Model": "lures/express_fishing/crankbaits_1/775/crankbaits_775",
+ "Hook": [
+ 700102
+ ],
+ "EfficacyBase": 50,
+ "Length": 0,
+ "Weight": 250
+ },
+ {
+ "Id": 80002,
+ "Model": "lures/express_fishing/poppers_1/poppers_590/poppers_590",
+ "Hook": [
+ 700102
+ ],
+ "EfficacyBase": 50,
+ "Length": 0,
+ "Weight": 120
+ },
+ {
+ "Id": 80003,
+ "Model": "lures/express_fishing/softplastic/ef_supergrab_6/softplastic_g_1622",
+ "Hook": [
+ 0
+ ],
+ "EfficacyBase": 50,
+ "Length": 0,
+ "Weight": 120
+ },
+ {
+ "Id": 80004,
+ "Model": "lures/express_fishing/softplastic/ef_superminnow_6/softplastic_m_1634",
+ "Hook": [
+ 0
+ ],
+ "EfficacyBase": 50,
+ "Length": 0,
+ "Weight": 120
+ }
+ ],
+ "ItemConfig": [
+ {
+ "Id": 10001,
+ "Model": "rods/syberia/tele_10037/tele_10037_t13",
+ "Type": 1,
+ "Max": 0,
+ "AutoUse": 0
+ },
+ {
+ "Id": 10002,
+ "Model": "rods/syberia/bolo_10021/bolo_10021_LB400",
+ "Type": 0,
+ "Max": 1100002,
+ "AutoUse": 0
+ },
+ {
+ "Id": 10003,
+ "Model": "rods/syberia/spin_10034/spin_10034_S60H",
+ "Type": 0,
+ "Max": 1100001,
+ "AutoUse": 0
+ }
+ ],
+ "ReelConfig": [
+ {
+ "Id": 40001,
+ "Model": "reels/syberia/spin_5002/spin_5002",
+ "Type": 0,
+ "GearRatio": [
+ "7"
+ ],
+ "Size": 250,
+ "Strength": 40
+ },
+ {
+ "Id": 40002,
+ "Model": "reels/syberia/spin_5036/spin_5036",
+ "Type": 0,
+ "GearRatio": [
+ "5"
+ ],
+ "Size": 120,
+ "Strength": 40
+ }
+ ],
+ "LineConfig": [
+ {
+ "Id": 60001,
+ "Model": "Lines/UFE Mono/UFE monoClear",
+ "Type": 0,
+ "Length": 7,
+ "Strength": 40,
+ "Size": 1
+ },
+ {
+ "Id": 60002,
+ "Model": "rods/syberia/bolo_10021/bolo_10021_LB400",
+ "Type": 0,
+ "Length": 5,
+ "Strength": 40,
+ "Size": 1
+ }
+ ],
+ "HookConfig": [
+ {
+ "Id": 90001,
+ "Model": "hooks/alliance/c_hook_20789_20794/c_hook_20789",
+ "Type": 1,
+ "Zadzior": 1,
+ "Length": 0,
+ "Weight": 1
+ },
+ {
+ "Id": 90002,
+ "Model": "hooks/berserk_hooks/triple_20569_20577/triple_20569",
+ "Type": 1,
+ "Zadzior": 1,
+ "Length": 0,
+ "Weight": 1
+ }
+ ],
+ "RodConfig": [
+ {
+ "Id": 30001,
+ "Model": "rods/syberia/tele_10037/tele_10037_t13",
+ "Type": 1,
+ "Ring": 0,
+ "Length": 7,
+ "Weight": 250,
+ "Strength": 40,
+ "MaxRange": 67,
+ "ConstructionType": 0
+ },
+ {
+ "Id": 30002,
+ "Model": "rods/syberia/bolo_10021/bolo_10021_LB400",
+ "Type": 0,
+ "Ring": 1100002,
+ "Length": 5,
+ "Weight": 120,
+ "Strength": 40,
+ "MaxRange": 30,
+ "ConstructionType": 0
+ },
+ {
+ "Id": 30003,
+ "Model": "rods/syberia/spin_10034/spin_10034_S60H",
+ "Type": 0,
+ "Ring": 1100001,
+ "Length": 5,
+ "Weight": 120,
+ "Strength": 40,
+ "MaxRange": 30,
+ "ConstructionType": 0
+ }
+ ],
+ "FishConfig": [
+ {
+ "Id": 210001,
+ "Model": [
+ "Burbot_B"
+ ],
+ "Type": 0,
+ "SpeciesName": 10,
+ "MinWeight": 1,
+ "MaxWeight": 34,
+ "Accept": 2100001
+ },
+ {
+ "Id": 210002,
+ "Model": [
+ "CarpCommon_B"
+ ],
+ "Type": 0,
+ "SpeciesName": 11,
+ "MinWeight": 1,
+ "MaxWeight": 34,
+ "Accept": 2100001
+ },
+ {
+ "Id": 210003,
+ "Model": [
+ "CarpGrass_B"
+ ],
+ "Type": 0,
+ "SpeciesName": 14,
+ "MinWeight": 1,
+ "MaxWeight": 34,
+ "Accept": 2100001
+ },
+ {
+ "Id": 210004,
+ "Model": [
+ "CarpCrucian_B"
+ ],
+ "Type": 0,
+ "SpeciesName": 16,
+ "MinWeight": 1,
+ "MaxWeight": 34,
+ "Accept": 2100001
+ }
+ ],
+ "BasicConfig": [
+ {
+ "Id": 1001,
+ "Name": "Weights/Weight2_5g",
+ "Val": [
+ "0"
+ ]
+ }
+ ],
+ "InitConfig": [
+ {
+ "Id": 1,
+ "ItemId": 30001,
+ "Amount": 1
+ },
+ {
+ "Id": 2,
+ "ItemId": 30002,
+ "Amount": 1
+ },
+ {
+ "Id": 3,
+ "ItemId": 30003,
+ "Amount": 1
+ },
+ {
+ "Id": 4,
+ "ItemId": 40001,
+ "Amount": 1
+ },
+ {
+ "Id": 5,
+ "ItemId": 50001,
+ "Amount": 1
+ },
+ {
+ "Id": 6,
+ "ItemId": 50002,
+ "Amount": 1
+ },
+ {
+ "Id": 7,
+ "ItemId": 50003,
+ "Amount": 1
+ },
+ {
+ "Id": 8,
+ "ItemId": 60001,
+ "Amount": 1
+ },
+ {
+ "Id": 9,
+ "ItemId": 70001,
+ "Amount": 1
+ },
+ {
+ "Id": 10,
+ "ItemId": 70002,
+ "Amount": 1
+ },
+ {
+ "Id": 11,
+ "ItemId": 80001,
+ "Amount": 1
+ },
+ {
+ "Id": 12,
+ "ItemId": 80002,
+ "Amount": 1
+ },
+ {
+ "Id": 13,
+ "ItemId": 80003,
+ "Amount": 1
+ },
+ {
+ "Id": 14,
+ "ItemId": 80004,
+ "Amount": 1
+ },
+ {
+ "Id": 15,
+ "ItemId": 90001,
+ "Amount": 1
+ },
+ {
+ "Id": 16,
+ "ItemId": 100001,
+ "Amount": 1
+ },
+ {
+ "Id": 17,
+ "ItemId": 10001,
+ "Amount": 100
+ },
+ {
+ "Id": 18,
+ "ItemId": 10002,
+ "Amount": 200
+ }
+ ],
+ "BobberConfig": [
+ {
+ "Id": 50001,
+ "Model": "bobbers/expressfishing/bob_25003/bob_25003",
+ "Type": 2,
+ "Weight": 1,
+ "Displacement": 40,
+ "NightLight": 0
+ },
+ {
+ "Id": 50002,
+ "Model": "bobbers/expressfishing/bob_25162_25163/bob_25162",
+ "Type": 0,
+ "Weight": 1,
+ "Displacement": 40,
+ "NightLight": 0
+ },
+ {
+ "Id": 50003,
+ "Model": "bobbers/expressfishing/bob_25166_25167/bob_25166",
+ "Type": 0,
+ "Weight": 1,
+ "Displacement": 40,
+ "NightLight": 0
+ },
+ {
+ "Id": 50004,
+ "Model": "bobbers/expressfishing/bob_25001/bob_25001",
+ "Type": 0,
+ "Weight": 1,
+ "Displacement": 40,
+ "NightLight": 0
+ }
+ ],
+ "FeederConfig": [
+ {
+ "Id": 110001,
+ "Model": "Feeders/Feeder 1/FeedTrash 1",
+ "Type": 0,
+ "Capacity": 100,
+ "Weight": 5
+ }
+ ],
+ "BaitConfig": [
+ {
+ "Id": 70001,
+ "Model": "baits/worm_01/worm_01",
+ "EfficacyBase": 15,
+ "Length": 0,
+ "Weight": 250,
+ "Arr": [
+ 250,
+ 1,
+ 2,
+ 3
+ ],
+ "ArrStr": [
+ "d",
+ "a",
+ "bb",
+ "e|12"
+ ]
+ },
+ {
+ "Id": 70002,
+ "Model": "baits/fly/fly",
+ "EfficacyBase": 15,
+ "Length": 0,
+ "Weight": 120,
+ "Arr": [
+ 120,
+ 4,
+ 3
+ ],
+ "ArrStr": [
+ "120",
+ "4",
+ "3"
+ ]
+ },
+ {
+ "Id": 70003,
+ "Model": "baits/black_leech/black_leech",
+ "EfficacyBase": 15,
+ "Length": 0,
+ "Weight": 120,
+ "Arr": [
+ 120
+ ],
+ "ArrStr": [
+ "kkk"
+ ]
+ },
+ {
+ "Id": 70004,
+ "Model": "baits/bread/bread",
+ "EfficacyBase": 15,
+ "Length": 0,
+ "Weight": 120,
+ "Arr": [
+ 120
+ ],
+ "ArrStr": [
+ "11|33",
+ "44|2"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Config/NetworkProtocol/Outer/GameMessage.proto b/Config/NetworkProtocol/Outer/GameMessage.proto
index c47bc71..3dea31f 100644
--- a/Config/NetworkProtocol/Outer/GameMessage.proto
+++ b/Config/NetworkProtocol/Outer/GameMessage.proto
@@ -35,6 +35,22 @@ message Game2C_ItemChange // ICustomRouteMessage,GameRoute
repeated int64 Removes = 3; //移除物品(移除时有)
}
+////////////// ******** 钓组 *******/////////////
+
+///请求安装或取下配件
+message C2Game_RigChangeRequest // ICustomRouteRequest,Game2C_RigChangeResponse,GameRoute
+{
+ int64 RodId = 1;//杆子id
+ int64 RigId = 2;//变更的配件
+ bool IsAdd = 3;//是否添加
+}
+
+///请求安装配件响应
+message Game2C_RigChangeResponse // ICustomRouteResponse
+{
+ ItemBindInfo Rigs = 1; //变化钓组信息
+}
+
////////////// ******** 鱼护 *******/////////////
diff --git a/Config/NetworkProtocol/Outer/data/CommonProtoData.proto b/Config/NetworkProtocol/Outer/data/CommonProtoData.proto
index ffe4920..0af1c58 100644
--- a/Config/NetworkProtocol/Outer/data/CommonProtoData.proto
+++ b/Config/NetworkProtocol/Outer/data/CommonProtoData.proto
@@ -9,8 +9,7 @@ message RoleBaseInfo
string Country = 3; //国家
int32 Level = 4; //等级
int32 Exp = 5; //当前等级
- bool Vip = 6; //是否vip
- VipInfo VipInfo = 7; //vip信息
+ VipInfo VipInfo = 6; //vip信息
}
@@ -45,15 +44,16 @@ message RoleSimpleInfo
string Head = 3; //头像
string Country = 4; //国家
int32 Level = 5; //等级
- bool Vip = 6; //是否vip
+ int32 Vip = 6; //vip级别
int32 MapId = 7; //当前所在地图
}
/// VIP信息
message VipInfo
{
- int64 OpenTime = 1; //开通时间
- int64 ExpirationTime = 2; //到期时间
+ int32 Level = 1; //VIP信息
+ int64 OpenTime = 2; //开通时间
+ int64 ExpirationTime = 3; //到期时间
}
diff --git a/Entity/Entity.csproj b/Entity/Entity.csproj
index 8e26470..5a06389 100644
--- a/Entity/Entity.csproj
+++ b/Entity/Entity.csproj
@@ -29,6 +29,9 @@
+
+
+
diff --git a/Entity/Game/Cache/PlayerBasicCache.cs b/Entity/Game/Cache/PlayerBasicCache.cs
index 8205f08..af6a76a 100644
--- a/Entity/Game/Cache/PlayerBasicCache.cs
+++ b/Entity/Game/Cache/PlayerBasicCache.cs
@@ -29,7 +29,7 @@ public class PlayerBasicCache : Entity
///
/// 是否是vip
///
- public bool IsVip;
+ public int Vip;
///
/// 缓存失效时间
diff --git a/Entity/Game/Item/Item.cs b/Entity/Game/Item/Item.cs
index 57d0571..d70a420 100644
--- a/Entity/Game/Item/Item.cs
+++ b/Entity/Game/Item/Item.cs
@@ -3,12 +3,12 @@ using MongoDB.Bson.Serialization.Attributes;
namespace NB.Game;
-public enum ItemType
+public enum ItemBasicType
{
- None = 0,
- Item,
- Equip,
- Fish,
+ None,
+ Currency = 1,
+ Item = 2,
+ Fish = 3,
}
public class Item : Entity
@@ -21,7 +21,7 @@ public class Item : Entity
///
/// 配置id
///
- [BsonElement("cid")] public int ConfigId;
+ [BsonElement("cid")] public uint ConfigId;
///
/// 是否绑定
@@ -46,5 +46,5 @@ public class Item : Entity
///
/// 物品所属的容器
///
- [BsonIgnore] PlayerItemContainer Container;
+ [BsonIgnore] PlayerItemContainerComponent Container;
}
\ No newline at end of file
diff --git a/Entity/Game/Item/PlayerItemContainer.cs b/Entity/Game/Item/PlayerItemContainerComponent.cs
similarity index 61%
rename from Entity/Game/Item/PlayerItemContainer.cs
rename to Entity/Game/Item/PlayerItemContainerComponent.cs
index eb41e01..050b78f 100644
--- a/Entity/Game/Item/PlayerItemContainer.cs
+++ b/Entity/Game/Item/PlayerItemContainerComponent.cs
@@ -6,7 +6,7 @@ using NB.Game;
namespace NB;
-public sealed class PlayerItemContainer : Entity
+public sealed class PlayerItemContainerComponent : Entity
{
///
/// 最大格子数量
@@ -24,14 +24,4 @@ public sealed class PlayerItemContainer : Entity
///
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
public Dictionary> FishingRig = new Dictionary>();
-
- // ///
- // /// 按物品id分组
- // ///
- // [BsonIgnore] public readonly OneToManyList ItemsByConfigId = new OneToManyListPool();
- //
- // ///
- // /// 容器内按物品类型分组
- // ///
- // [BsonIgnore] public readonly OneToManyList ItemsByType = new OneToManyListPool();
}
\ No newline at end of file
diff --git a/Entity/Game/Player/Player.cs b/Entity/Game/Player/Player.cs
index e662cb6..bd2dbd6 100644
--- a/Entity/Game/Player/Player.cs
+++ b/Entity/Game/Player/Player.cs
@@ -34,7 +34,7 @@ public sealed class Player : Entity
/// 当前经验
///
[BsonElement("exp")] public int Exp;
-
+
///
/// 星数
@@ -47,41 +47,20 @@ public sealed class Player : Entity
[BsonElement("high")] public int Highlight;
///
- /// 角色vip信息
+ /// vip状态
///
- [BsonElement("vInfo")] public PlayerVip Vip;
+ [BsonElement("vip")] public int Vip;
///
- /// 钱包
+ /// 获取时间
///
- [BsonElement("wallet")] public PlayerWallet Wallet;
+ [BsonElement("vTime")] public long VipGetTime;
///
- /// 背包
+ /// 失效时间
///
- [BsonElement("bag")] public PlayerItemContainer ItemContainer;
+ [BsonElement("vExTime")] public long VipExpirationTime;
- ///
- /// 鱼护
- ///
- [BsonElement("fish")] public FishContainer FishContainer;
-
- ///
- /// 技能
- ///
- [BsonElement("skill")] public SkillContainer SkillContainer;
-
- ///
- /// 成就
- ///
- [BsonElement("achievement")] public AchievementContainer AchievementContainer;
-
- ///
- /// 是否是vip
- ///
- [BsonIgnore]
- public bool IsVip => Vip != null && Vip.ExpirationTime > TimeHelper.Now;
[BsonIgnore] public long SessionRunTimeId;
-
}
\ No newline at end of file
diff --git a/Entity/Game/Player/PlayerWallet.cs b/Entity/Game/Player/PlayerWalletComponent.cs
similarity index 53%
rename from Entity/Game/Player/PlayerWallet.cs
rename to Entity/Game/Player/PlayerWalletComponent.cs
index c4ee134..0682333 100644
--- a/Entity/Game/Player/PlayerWallet.cs
+++ b/Entity/Game/Player/PlayerWalletComponent.cs
@@ -7,21 +7,11 @@ namespace NB.Game;
///
/// 用户钱包
///
-public class PlayerWallet : Entity
+public class PlayerWalletComponent : Entity
{
///
- /// 余额
- ///
- public int Money;
-
- ///
- /// 金币
- ///
- public int Gold;
-
- ///
- /// 其他货币
+ /// 所有货币
///
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
- public Dictionary Other = new();
+ public Dictionary Currency = new();
}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/BaitConfig.cs b/Entity/Generate/ConfigTable/Entity/BaitConfig.cs
index 54a1f1c..45e4c9d 100644
--- a/Entity/Generate/ConfigTable/Entity/BaitConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/BaitConfig.cs
@@ -5,88 +5,15 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class BaitConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class BaitConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static BaitConfigData _instance = null;
-
- public static BaitConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public BaitConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"BaitConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out BaitConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class BaitConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
@@ -96,6 +23,71 @@ namespace Fantasy
[ProtoMember(4)]
public uint Length { get; set; } // 长度(毫米)
[ProtoMember(5)]
- public uint Weight { get; set; } // 重量(克)
- }
-}
\ No newline at end of file
+ public uint Weight { get; set; } // 重量(克)
+ [ProtoMember(6)]
+ public uint[] Arr { get; set; } = Array.Empty(); // 重量(克)
+ [ProtoMember(7)]
+ public string[] ArrStr { get; set; } = Array.Empty(); // 重量(克)
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static BaitConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static BaitConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static BaitConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static BaitConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static BaitConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static BaitConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/BasicConfig.cs b/Entity/Generate/ConfigTable/Entity/BasicConfig.cs
new file mode 100644
index 0000000..a9a9cbb
--- /dev/null
+++ b/Entity/Generate/ConfigTable/Entity/BasicConfig.cs
@@ -0,0 +1,85 @@
+using System;
+using ProtoBuf;
+using Fantasy;
+using System.Linq;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Collections.Concurrent;
+using Fantasy.Serialize;
+using Fantasy.ConfigTable;
+
+namespace NBF
+{
+ [ProtoContract]
+ public sealed partial class BasicConfig : ASerialize, IProto, IConfigTable
+ {
+
+ [ProtoMember(1)]
+ public uint Id { get; set; } // Id
+ [ProtoMember(2)]
+ public string Name { get; set; } // 参数名
+ [ProtoMember(3)]
+ public string[] Val { get; set; } = Array.Empty(); // 参数值
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static BasicConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static BasicConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static BasicConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static BasicConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static BasicConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static BasicConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/BobberConfig.cs b/Entity/Generate/ConfigTable/Entity/BobberConfig.cs
index 8afe79f..c752882 100644
--- a/Entity/Generate/ConfigTable/Entity/BobberConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/BobberConfig.cs
@@ -5,88 +5,15 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class BobberConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class BobberConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static BobberConfigData _instance = null;
-
- public static BobberConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public BobberConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"BobberConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out BobberConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class BobberConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
@@ -99,5 +26,66 @@ namespace Fantasy
public uint Displacement { get; set; } // 位移
[ProtoMember(6)]
public uint NightLight { get; set; } // 是否夜光
- }
-}
\ No newline at end of file
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static BobberConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static BobberConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static BobberConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static BobberConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static BobberConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static BobberConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/FeederConfig.cs b/Entity/Generate/ConfigTable/Entity/FeederConfig.cs
index 7d092aa..83df9d8 100644
--- a/Entity/Generate/ConfigTable/Entity/FeederConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/FeederConfig.cs
@@ -5,88 +5,15 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class FeederConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class FeederConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static FeederConfigData _instance = null;
-
- public static FeederConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public FeederConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"FeederConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out FeederConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class FeederConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
@@ -97,5 +24,66 @@ namespace Fantasy
public uint Capacity { get; set; } // 能力
[ProtoMember(5)]
public uint Weight { get; set; } // 重量(克)
- }
-}
\ No newline at end of file
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static FeederConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static FeederConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static FeederConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static FeederConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static FeederConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static FeederConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/FishConfig.cs b/Entity/Generate/ConfigTable/Entity/FishConfig.cs
index 2ed0c08..ed434cf 100644
--- a/Entity/Generate/ConfigTable/Entity/FishConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/FishConfig.cs
@@ -5,88 +5,15 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class FishConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class FishConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static FishConfigData _instance = null;
-
- public static FishConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public FishConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"FishConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out FishConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class FishConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
@@ -101,5 +28,66 @@ namespace Fantasy
public uint MaxWeight { get; set; } // 最大重量(克)
[ProtoMember(7)]
public uint Accept { get; set; } // 接受饵
- }
-}
\ No newline at end of file
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static FishConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static FishConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static FishConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static FishConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static FishConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static FishConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/HookConfig.cs b/Entity/Generate/ConfigTable/Entity/HookConfig.cs
index 98722e1..5350f5f 100644
--- a/Entity/Generate/ConfigTable/Entity/HookConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/HookConfig.cs
@@ -5,88 +5,15 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class HookConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class HookConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static HookConfigData _instance = null;
-
- public static HookConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public HookConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"HookConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out HookConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class HookConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
@@ -99,5 +26,66 @@ namespace Fantasy
public uint Length { get; set; } // 长度(毫米)
[ProtoMember(6)]
public uint Weight { get; set; } // 重量(克)
- }
-}
\ No newline at end of file
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static HookConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static HookConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static HookConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static HookConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static HookConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static HookConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/InitConfig.cs b/Entity/Generate/ConfigTable/Entity/InitConfig.cs
new file mode 100644
index 0000000..b67b530
--- /dev/null
+++ b/Entity/Generate/ConfigTable/Entity/InitConfig.cs
@@ -0,0 +1,85 @@
+using System;
+using ProtoBuf;
+using Fantasy;
+using System.Linq;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Collections.Concurrent;
+using Fantasy.Serialize;
+using Fantasy.ConfigTable;
+
+namespace NBF
+{
+ [ProtoContract]
+ public sealed partial class InitConfig : ASerialize, IProto, IConfigTable
+ {
+
+ [ProtoMember(1)]
+ public uint Id { get; set; } // Id
+ [ProtoMember(2)]
+ public uint ItemId { get; set; } // 物品Id
+ [ProtoMember(3)]
+ public int Amount { get; set; } // 数量
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static InitConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static InitConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static InitConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static InitConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static InitConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static InitConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/ItemConfig.cs b/Entity/Generate/ConfigTable/Entity/ItemConfig.cs
new file mode 100644
index 0000000..69760bb
--- /dev/null
+++ b/Entity/Generate/ConfigTable/Entity/ItemConfig.cs
@@ -0,0 +1,89 @@
+using System;
+using ProtoBuf;
+using Fantasy;
+using System.Linq;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Collections.Concurrent;
+using Fantasy.Serialize;
+using Fantasy.ConfigTable;
+
+namespace NBF
+{
+ [ProtoContract]
+ public sealed partial class ItemConfig : ASerialize, IProto, IConfigTable
+ {
+
+ [ProtoMember(1)]
+ public uint Id { get; set; } // Id
+ [ProtoMember(2)]
+ public string Model { get; set; } // 模型
+ [ProtoMember(3)]
+ public uint Type { get; set; } // 类型
+ [ProtoMember(4)]
+ public uint Max { get; set; } // 最大堆叠数量
+ [ProtoMember(5)]
+ public uint AutoUse { get; set; } // 获得自动使用
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static ItemConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static ItemConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static ItemConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static ItemConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static ItemConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static ItemConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/LineConfig.cs b/Entity/Generate/ConfigTable/Entity/LineConfig.cs
index 1399198..afb75f2 100644
--- a/Entity/Generate/ConfigTable/Entity/LineConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/LineConfig.cs
@@ -5,88 +5,15 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class LineConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class LineConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static LineConfigData _instance = null;
-
- public static LineConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public LineConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"LineConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out LineConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class LineConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
@@ -99,5 +26,66 @@ namespace Fantasy
public uint Strength { get; set; } // 强度
[ProtoMember(6)]
public uint Size { get; set; } // 尺寸
- }
-}
\ No newline at end of file
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static LineConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static LineConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static LineConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static LineConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static LineConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static LineConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/LureConfig.cs b/Entity/Generate/ConfigTable/Entity/LureConfig.cs
index 764f5d2..f7b696e 100644
--- a/Entity/Generate/ConfigTable/Entity/LureConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/LureConfig.cs
@@ -5,88 +5,15 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class LureConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class LureConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static LureConfigData _instance = null;
-
- public static LureConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public LureConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"LureConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out LureConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class LureConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
@@ -99,5 +26,66 @@ namespace Fantasy
public uint Length { get; set; } // 长度(毫米)
[ProtoMember(6)]
public uint Weight { get; set; } // 重量(克)
- }
-}
\ No newline at end of file
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static LureConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static LureConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static LureConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static LureConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static LureConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static LureConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/ReelConfig.cs b/Entity/Generate/ConfigTable/Entity/ReelConfig.cs
index 16e0839..3c96a82 100644
--- a/Entity/Generate/ConfigTable/Entity/ReelConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/ReelConfig.cs
@@ -5,88 +5,15 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class ReelConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class ReelConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static ReelConfigData _instance = null;
-
- public static ReelConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public ReelConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"ReelConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out ReelConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class ReelConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
@@ -99,5 +26,66 @@ namespace Fantasy
public uint Size { get; set; } // 尺寸
[ProtoMember(6)]
public uint Strength { get; set; } // 强度
- }
-}
\ No newline at end of file
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static ReelConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static ReelConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static ReelConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static ReelConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static ReelConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static ReelConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/RingConfig.cs b/Entity/Generate/ConfigTable/Entity/RingConfig.cs
index a0e39c6..8627804 100644
--- a/Entity/Generate/ConfigTable/Entity/RingConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/RingConfig.cs
@@ -5,91 +5,79 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class RingConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class RingConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static RingConfigData _instance = null;
-
- public static RingConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public RingConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"RingConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out RingConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class RingConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public string Model { get; set; } // 模型
- }
-}
\ No newline at end of file
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static RingConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static RingConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static RingConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static RingConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static RingConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static RingConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/RodConfig.cs b/Entity/Generate/ConfigTable/Entity/RodConfig.cs
index 2fabc5e..b21e903 100644
--- a/Entity/Generate/ConfigTable/Entity/RodConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/RodConfig.cs
@@ -5,88 +5,15 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class RodConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class RodConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static RodConfigData _instance = null;
-
- public static RodConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public RodConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"RodConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out RodConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class RodConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
@@ -105,5 +32,66 @@ namespace Fantasy
public uint MaxRange { get; set; } // 最大范围
[ProtoMember(9)]
public uint ConstructionType { get; set; } // 结构类型
- }
-}
\ No newline at end of file
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static RodConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static RodConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static RodConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static RodConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static RodConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static RodConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/UnitConfig.cs b/Entity/Generate/ConfigTable/Entity/UnitConfig.cs
deleted file mode 100644
index c0f11d9..0000000
--- a/Entity/Generate/ConfigTable/Entity/UnitConfig.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-using System;
-using ProtoBuf;
-using Fantasy;
-using System.Linq;
-using System.Reflection;
-using System.Collections.Generic;
-using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
-using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
-
-namespace Fantasy
-{
- [ProtoContract]
- public sealed partial class UnitConfigData : ASerialize, IConfigTable, IProto
- {
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static UnitConfigData _instance = null;
-
- public static UnitConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public UnitConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
-
- if (check)
- {
- throw new Exception($"UnitConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out UnitConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class UnitConfig : ASerialize, IProto
- {
- [ProtoMember(1)]
- public uint Id { get; set; } // Id
- [ProtoMember(2)]
- public string Name { get; set; } // 名称
- [ProtoMember(3)]
- public string Model { get; set; } // 数据库类型
- [ProtoMember(4)]
- public StringDictionaryConfig Dic { get; set; } // 字典类型
- }
-}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Entity/WeightConfig.cs b/Entity/Generate/ConfigTable/Entity/WeightConfig.cs
index c372e52..fc0d498 100644
--- a/Entity/Generate/ConfigTable/Entity/WeightConfig.cs
+++ b/Entity/Generate/ConfigTable/Entity/WeightConfig.cs
@@ -5,88 +5,15 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
-using Fantasy.ConfigTable;
using Fantasy.Serialize;
-// ReSharper disable CollectionNeverUpdated.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-#pragma warning disable CS0169
-#pragma warning disable CS8618
-#pragma warning disable CS8625
-#pragma warning disable CS8603
+using Fantasy.ConfigTable;
-namespace Fantasy
+namespace NBF
{
[ProtoContract]
- public sealed partial class WeightConfigData : ASerialize, IConfigTable, IProto
+ public sealed partial class WeightConfig : ASerialize, IProto, IConfigTable
{
- [ProtoMember(1)]
- public List List { get; set; } = new List();
-#if FANTASY_NET
- [ProtoIgnore]
- private readonly ConcurrentDictionary _configs = new ConcurrentDictionary();
-#else
- [ProtoIgnore]
- private readonly Dictionary _configs = new Dictionary();
-#endif
- private static WeightConfigData _instance = null;
-
- public static WeightConfigData Instance
- {
- get { return _instance ??= ConfigTableHelper.Load(); }
- private set => _instance = value;
- }
-
- public WeightConfig Get(uint id, bool check = true)
- {
- if (_configs.ContainsKey(id))
- {
- return _configs[id];
- }
- if (check)
- {
- throw new Exception($"WeightConfig not find {id} Id");
- }
-
- return null;
- }
- public bool TryGet(uint id, out WeightConfig config)
- {
- config = null;
-
- if (!_configs.ContainsKey(id))
- {
- return false;
- }
-
- config = _configs[id];
- return true;
- }
- public override void AfterDeserialization()
- {
- foreach (var config in List)
- {
-#if FANTASY_NET
- _configs.TryAdd(config.Id, config);
-#else
- _configs.Add(config.Id, config);
-#endif
- config.AfterDeserialization();
- }
-
- EndInit();
- }
-
- public override void Dispose()
- {
- Instance = null;
- }
- }
-
- [ProtoContract]
- public sealed partial class WeightConfig : ASerialize, IProto
- {
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
@@ -95,5 +22,66 @@ namespace Fantasy
public uint Type { get; set; } // 类型
[ProtoMember(4)]
public uint Weight { get; set; } // 重量(克)
- }
-}
\ No newline at end of file
+ [ProtoIgnore]
+ public uint Key => Id;
+
+ #region Static
+
+ private static ConfigContext Context => ConfigTableHelper.Table();
+
+ public static WeightConfig Get(uint key)
+ {
+ return Context.Get(key);
+ }
+
+ public static WeightConfig Get(Predicate match)
+ {
+ return Context.Get(match);
+ }
+
+ public static WeightConfig Fist()
+ {
+ return Context.Fist();
+ }
+
+ public static WeightConfig Last()
+ {
+ return Context.Last();
+ }
+
+ public static WeightConfig Fist(Predicate match)
+ {
+ return Context.Fist(match);
+ }
+
+ public static WeightConfig Last(Predicate match)
+ {
+ return Context.Last(match);
+ }
+
+ public static int Count()
+ {
+ return Context.Count();
+ }
+
+ public static int Count(Func predicate)
+ {
+ return Context.Count(predicate);
+ }
+
+ public static List GetList()
+ {
+ return Context.GetList();
+ }
+
+ public static List GetList(Predicate match)
+ {
+ return Context.GetList(match);
+ }
+ public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
+ {
+ ConfigTableHelper.ParseLine(arr);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Entity/Generate/ConfigTable/Partial/UnitConfigData.cs b/Entity/Generate/ConfigTable/Partial/UnitConfigData.cs
deleted file mode 100644
index 36e9c93..0000000
--- a/Entity/Generate/ConfigTable/Partial/UnitConfigData.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace Fantasy;
-
-public sealed partial class UnitConfigData
-{
- public override void EndInit()
- {
- Log.Debug("UnitConfigData EndInit");
- base.EndInit();
- }
-}
\ No newline at end of file
diff --git a/Entity/Generate/NetworkProtocol/CommonProtoData.cs b/Entity/Generate/NetworkProtocol/CommonProtoData.cs
index 4b8ed66..5198cd9 100644
--- a/Entity/Generate/NetworkProtocol/CommonProtoData.cs
+++ b/Entity/Generate/NetworkProtocol/CommonProtoData.cs
@@ -34,7 +34,6 @@ namespace Fantasy
Country = default;
Level = default;
Exp = default;
- Vip = default;
VipInfo = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return(this);
@@ -51,8 +50,6 @@ namespace Fantasy
[ProtoMember(5)]
public int Exp { get; set; }
[ProtoMember(6)]
- public bool Vip { get; set; }
- [ProtoMember(7)]
public VipInfo VipInfo { get; set; }
}
[ProtoContract]
@@ -156,7 +153,7 @@ namespace Fantasy
[ProtoMember(5)]
public int Level { get; set; }
[ProtoMember(6)]
- public bool Vip { get; set; }
+ public int Vip { get; set; }
[ProtoMember(7)]
public int MapId { get; set; }
}
@@ -172,6 +169,7 @@ namespace Fantasy
}
public override void Dispose()
{
+ Level = default;
OpenTime = default;
ExpirationTime = default;
#if FANTASY_NET || FANTASY_UNITY
@@ -179,8 +177,10 @@ namespace Fantasy
#endif
}
[ProtoMember(1)]
- public long OpenTime { get; set; }
+ public int Level { get; set; }
[ProtoMember(2)]
+ public long OpenTime { get; set; }
+ [ProtoMember(3)]
public long ExpirationTime { get; set; }
}
///
diff --git a/Fantasy/Fantasy.Net/Fantasy.Net/Fantasy.Net.csproj b/Fantasy/Fantasy.Net/Fantasy.Net/Fantasy.Net.csproj
index 732718c..be19e19 100644
--- a/Fantasy/Fantasy.Net/Fantasy.Net/Fantasy.Net.csproj
+++ b/Fantasy/Fantasy.Net/Fantasy.Net/Fantasy.Net.csproj
@@ -40,15 +40,10 @@
-
-
-
+
+
-
-
-
-
-
+
@@ -58,4 +53,8 @@
+
+
+
+
diff --git a/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/DataBase/MongoDataBase.cs b/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/DataBase/MongoDataBase.cs
index afb7f09..49948f4 100644
--- a/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/DataBase/MongoDataBase.cs
+++ b/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/DataBase/MongoDataBase.cs
@@ -92,11 +92,6 @@ namespace Fantasy.DataBase
return data == null ? 0 : Convert.ToInt64(data["Result"]);
}
- ///
- /// Mongo 注释
- ///
- public MongoClient Client => _mongoClient;
-
#endregion
#region GetCollection
diff --git a/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/Entitas/Component/CoroutineLock/CoroutineLockComponent.cs b/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/Entitas/Component/CoroutineLock/CoroutineLockComponent.cs
index 4644274..fe03298 100644
--- a/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/Entitas/Component/CoroutineLock/CoroutineLockComponent.cs
+++ b/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/Entitas/Component/CoroutineLock/CoroutineLockComponent.cs
@@ -82,7 +82,7 @@ namespace Fantasy.Async
///
///
///
- public void Release(int coroutineLockType, long coroutineLockQueueKey)
+ public void Release(long coroutineLockType, long coroutineLockQueueKey)
{
if (IsDisposed)
{
diff --git a/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/Entitas/Component/EntityComponent.cs b/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/Entitas/Component/EntityComponent.cs
index b367448..67dc9ef 100644
--- a/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/Entitas/Component/EntityComponent.cs
+++ b/Fantasy/Fantasy.Net/Fantasy.Net/Runtime/Core/Entitas/Component/EntityComponent.cs
@@ -67,11 +67,15 @@ namespace Fantasy.Entitas
return HashCode.Combine(CustomEventType, EntitiesType);
}
}
-
+
///
/// Entity管理组件
///
+#if FANTASY_UNITY
+ public sealed class EntityComponent : Entity, ISceneUpdate, ISceneLateUpdate, IAssembly
+#else
public sealed class EntityComponent : Entity, ISceneUpdate, IAssembly
+#endif
{
private readonly OneToManyList _assemblyList = new();
private readonly OneToManyList _assemblyHashCodes = new();
@@ -80,15 +84,19 @@ namespace Fantasy.Entitas
private readonly Dictionary _updateSystems = new();
private readonly Dictionary _destroySystems = new();
private readonly Dictionary _deserializeSystems = new();
- private readonly Dictionary _frameUpdateSystem = new();
private readonly OneToManyList _assemblyCustomSystemList = new();
private readonly Dictionary _customEntitiesSystems = new Dictionary();
private readonly Dictionary _hashCodes = new Dictionary();
private readonly Queue _updateQueue = new Queue();
- private readonly Queue _frameUpdateQueue = new Queue();
+
private readonly Dictionary _updateQueueDic = new Dictionary();
+#if FANTASY_UNITY
+ private readonly Dictionary _lateUpdateSystems = new();
+ private readonly Queue _lateUpdateQueue = new Queue();
+ private readonly Dictionary _lateUpdateQueueDic = new Dictionary();
+#endif
internal async FTask