mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Update
Update
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GameConfig.item
|
||||
{
|
||||
public enum EQuality
|
||||
{
|
||||
/// <summary>
|
||||
/// 最差品质
|
||||
/// </summary>
|
||||
WHITE = 1,
|
||||
/// <summary>
|
||||
/// 蓝色的
|
||||
/// </summary>
|
||||
BLUE = 2,
|
||||
/// <summary>
|
||||
/// 紫色的
|
||||
/// </summary>
|
||||
PURPLE = 3,
|
||||
/// <summary>
|
||||
/// 最高品质
|
||||
/// </summary>
|
||||
RED = 4,
|
||||
}
|
||||
|
||||
}
|
120
Assets/GameScripts/DotNet/Logic/Config~/GameConfig/item/Item.cs
Normal file
120
Assets/GameScripts/DotNet/Logic/Config~/GameConfig/item/Item.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace GameConfig.item
|
||||
{
|
||||
public sealed partial class Item : Bright.Config.BeanBase
|
||||
{
|
||||
public Item(ByteBuf _buf)
|
||||
{
|
||||
Id = _buf.ReadInt();
|
||||
Name = _buf.ReadString();
|
||||
Desc = _buf.ReadString();
|
||||
Price = _buf.ReadInt();
|
||||
UpgradeToItemId = _buf.ReadInt();
|
||||
if(_buf.ReadBool()){ ExpireTime = _buf.ReadInt(); } else { ExpireTime = null; }
|
||||
BatchUseable = _buf.ReadBool();
|
||||
Quality = (item.EQuality)_buf.ReadInt();
|
||||
ExchangeStream = item.ItemExchange.DeserializeItemExchange(_buf);
|
||||
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);ExchangeList = new System.Collections.Generic.List<item.ItemExchange>(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { item.ItemExchange _e0; _e0 = item.ItemExchange.DeserializeItemExchange(_buf); ExchangeList.Add(_e0);}}
|
||||
ExchangeColumn = item.ItemExchange.DeserializeItemExchange(_buf);
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static Item DeserializeItem(ByteBuf _buf)
|
||||
{
|
||||
return new item.Item(_buf);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 这是id
|
||||
/// </summary>
|
||||
public int Id { get; private set; }
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public string Name { get; private set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string Desc { get; private set; }
|
||||
/// <summary>
|
||||
/// 价格
|
||||
/// </summary>
|
||||
public int Price { get; private set; }
|
||||
/// <summary>
|
||||
/// 引用当前表
|
||||
/// </summary>
|
||||
public int UpgradeToItemId { get; private set; }
|
||||
public item.Item UpgradeToItemId_Ref { get; private set; }
|
||||
/// <summary>
|
||||
/// 过期时间
|
||||
/// </summary>
|
||||
public int? ExpireTime { get; private set; }
|
||||
/// <summary>
|
||||
/// 能否批量使用
|
||||
/// </summary>
|
||||
public bool BatchUseable { get; private set; }
|
||||
/// <summary>
|
||||
/// 品质
|
||||
/// </summary>
|
||||
public item.EQuality Quality { get; private set; }
|
||||
/// <summary>
|
||||
/// 道具兑换配置
|
||||
/// </summary>
|
||||
public item.ItemExchange ExchangeStream { get; private set; }
|
||||
public System.Collections.Generic.List<item.ItemExchange> ExchangeList { get; private set; }
|
||||
/// <summary>
|
||||
/// 道具兑换配置
|
||||
/// </summary>
|
||||
public item.ItemExchange ExchangeColumn { get; private set; }
|
||||
|
||||
public const int __ID__ = 2107285806;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
this.UpgradeToItemId_Ref = (_tables["item.TbItem"] as item.TbItem).GetOrDefault(UpgradeToItemId);
|
||||
ExchangeStream?.Resolve(_tables);
|
||||
foreach(var _e in ExchangeList) { _e?.Resolve(_tables); }
|
||||
ExchangeColumn?.Resolve(_tables);
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
ExchangeStream?.TranslateText(translator);
|
||||
foreach(var _e in ExchangeList) { _e?.TranslateText(translator); }
|
||||
ExchangeColumn?.TranslateText(translator);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "Id:" + Id + ","
|
||||
+ "Name:" + Name + ","
|
||||
+ "Desc:" + Desc + ","
|
||||
+ "Price:" + Price + ","
|
||||
+ "UpgradeToItemId:" + UpgradeToItemId + ","
|
||||
+ "ExpireTime:" + ExpireTime + ","
|
||||
+ "BatchUseable:" + BatchUseable + ","
|
||||
+ "Quality:" + Quality + ","
|
||||
+ "ExchangeStream:" + ExchangeStream + ","
|
||||
+ "ExchangeList:" + Bright.Common.StringUtil.CollectionToString(ExchangeList) + ","
|
||||
+ "ExchangeColumn:" + ExchangeColumn + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace GameConfig.item
|
||||
{
|
||||
public sealed partial class ItemExchange : Bright.Config.BeanBase
|
||||
{
|
||||
public ItemExchange(ByteBuf _buf)
|
||||
{
|
||||
Id = _buf.ReadInt();
|
||||
Num = _buf.ReadInt();
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static ItemExchange DeserializeItemExchange(ByteBuf _buf)
|
||||
{
|
||||
return new item.ItemExchange(_buf);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 道具id
|
||||
/// </summary>
|
||||
public int Id { get; private set; }
|
||||
/// <summary>
|
||||
/// 道具数量
|
||||
/// </summary>
|
||||
public int Num { get; private set; }
|
||||
|
||||
public const int __ID__ = 1814660465;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "Id:" + Id + ","
|
||||
+ "Num:" + Num + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace GameConfig.item
|
||||
{
|
||||
|
||||
public partial class TbItem
|
||||
{
|
||||
private readonly Dictionary<int, item.Item> _dataMap;
|
||||
private readonly List<item.Item> _dataList;
|
||||
|
||||
public TbItem(ByteBuf _buf)
|
||||
{
|
||||
_dataMap = new Dictionary<int, item.Item>();
|
||||
_dataList = new List<item.Item>();
|
||||
|
||||
for(int n = _buf.ReadSize() ; n > 0 ; --n)
|
||||
{
|
||||
item.Item _v;
|
||||
_v = item.Item.DeserializeItem(_buf);
|
||||
_dataList.Add(_v);
|
||||
_dataMap.Add(_v.Id, _v);
|
||||
}
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public Dictionary<int, item.Item> DataMap => _dataMap;
|
||||
public List<item.Item> DataList => _dataList;
|
||||
|
||||
public item.Item GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public item.Item Get(int key) => _dataMap[key];
|
||||
public item.Item this[int key] => _dataMap[key];
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
foreach(var v in _dataList)
|
||||
{
|
||||
v.Resolve(_tables);
|
||||
}
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
foreach(var v in _dataList)
|
||||
{
|
||||
v.TranslateText(translator);
|
||||
}
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user