艹
This commit is contained in:
46
Entity/Game/Container/Container.cs
Normal file
46
Entity/Game/Container/Container.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Fantasy.DataStructure.Collection;
|
||||
using Fantasy.Entitas;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using MongoDB.Bson.Serialization.Options;
|
||||
using NB.Game;
|
||||
|
||||
namespace NB;
|
||||
|
||||
public sealed class Container : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 可用格子数量
|
||||
/// </summary>
|
||||
public int CellCount;
|
||||
|
||||
/// <summary>
|
||||
/// 最大格子数量
|
||||
/// </summary>
|
||||
public int CellCountMax;
|
||||
|
||||
/// <summary>
|
||||
/// 当前已经使用格子数量
|
||||
/// </summary>
|
||||
public int CurrentCellCount;
|
||||
|
||||
/// <summary>
|
||||
/// 容器内的物品
|
||||
/// </summary>
|
||||
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
|
||||
public Dictionary<long, Item> Items = new Dictionary<long, Item>();
|
||||
|
||||
/// <summary>
|
||||
/// 容器内物品,按格子进行分组
|
||||
/// </summary>
|
||||
[BsonIgnore] public Dictionary<uint, Item> ItemsByCell = new Dictionary<uint, Item>();
|
||||
|
||||
/// <summary>
|
||||
/// 按物品id分组
|
||||
/// </summary>
|
||||
[BsonIgnore] public readonly OneToManyList<uint, Item> ItemsByConfigId = new OneToManyListPool<uint, Item>();
|
||||
|
||||
/// <summary>
|
||||
/// 容器内按物品类型分组
|
||||
/// </summary>
|
||||
[BsonIgnore] public readonly OneToManyList<uint, Item> ItemsByType = new OneToManyListPool<uint, Item>();
|
||||
}
|
||||
23
Entity/Game/Container/ContainerComponent.cs
Normal file
23
Entity/Game/Container/ContainerComponent.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB;
|
||||
|
||||
public enum ContainerType : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// 背包
|
||||
/// </summary>
|
||||
Bag,
|
||||
|
||||
/// <summary>
|
||||
/// 鱼护
|
||||
/// </summary>
|
||||
FishBag,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物品容器组件
|
||||
/// </summary>
|
||||
public class ContainerComponent : Entity
|
||||
{
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class Currency : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 配置id
|
||||
/// </summary>
|
||||
public int ConfigId;
|
||||
|
||||
/// <summary>
|
||||
/// 拥有的数量
|
||||
/// </summary>
|
||||
public int Count;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
namespace NB.Game;
|
||||
|
||||
public class DayFlags
|
||||
{
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class GamingInfo : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 地图
|
||||
/// </summary>
|
||||
public int Map;
|
||||
|
||||
/// <summary>
|
||||
/// 位置
|
||||
/// </summary>
|
||||
public int Pos;
|
||||
|
||||
/// <summary>
|
||||
/// 进入时间
|
||||
/// </summary>
|
||||
public int Time;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class Guide : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int Sort;
|
||||
|
||||
/// <summary>
|
||||
/// 配置id
|
||||
/// </summary>
|
||||
public int ConfigId;
|
||||
|
||||
/// <summary>
|
||||
/// 步骤
|
||||
/// </summary>
|
||||
public int Step;
|
||||
|
||||
/// <summary>
|
||||
/// 触发时间
|
||||
/// </summary>
|
||||
public long GetTime;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class MapMatter : Entity
|
||||
{
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class Mission : Entity
|
||||
{
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace Fantasy;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家信息
|
||||
/// </summary>
|
||||
public class Player : Entity
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class Skill : Entity
|
||||
{
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
using NB.Game;
|
||||
|
||||
namespace NB;
|
||||
|
||||
public class UserInfo : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础信息
|
||||
/// </summary>
|
||||
public BasicInfo BasicInfo;
|
||||
|
||||
/// <summary>
|
||||
/// 统计信息
|
||||
/// </summary>
|
||||
public UserStatisticsInfo Statistics;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏信息
|
||||
/// </summary>
|
||||
public GamingInfo GamingInfo;
|
||||
|
||||
/// <summary>
|
||||
/// 货币信息
|
||||
/// </summary>
|
||||
public List<Currency> Currency;
|
||||
|
||||
/// <summary>
|
||||
/// 拥有的物品
|
||||
/// </summary>
|
||||
public List<Item> Items;
|
||||
|
||||
/// <summary>
|
||||
/// 参与的活动
|
||||
/// </summary>
|
||||
public List<Activity> Activity;
|
||||
|
||||
/// <summary>
|
||||
/// 任务列表
|
||||
/// </summary>
|
||||
public List<Mission> Missions;
|
||||
|
||||
/// <summary>
|
||||
/// 账号标识
|
||||
/// </summary>
|
||||
public DayFlags DayFlags;
|
||||
|
||||
/// <summary>
|
||||
/// 拥有的技能
|
||||
/// </summary>
|
||||
public List<Skill> Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// 引导情况
|
||||
/// </summary>
|
||||
public List<Guide> Guides;
|
||||
|
||||
/// <summary>
|
||||
/// 地图情况
|
||||
/// </summary>
|
||||
public List<MapMatter> MapMatters;
|
||||
}
|
||||
@@ -1,7 +1,16 @@
|
||||
using Fantasy.Entitas;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public enum ItemType
|
||||
{
|
||||
None = 0,
|
||||
Item,
|
||||
Equip,
|
||||
Fish,
|
||||
}
|
||||
|
||||
public class Item : Entity
|
||||
{
|
||||
/// <summary>
|
||||
@@ -18,4 +27,9 @@ public class Item : Entity
|
||||
/// 是否绑定
|
||||
/// </summary>
|
||||
public bool IsBind;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当前所属的容器
|
||||
/// </summary>
|
||||
[BsonIgnore] public Container Container;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class Activity : Entity
|
||||
public class ItemComponent : Entity
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Game;
|
||||
namespace NB;
|
||||
|
||||
public class BasicInfo : Entity
|
||||
/// <summary>
|
||||
/// 角色基础数据
|
||||
/// </summary>
|
||||
[RoleCom]
|
||||
public class RoleBasic : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
15
Entity/Game/Role/Child/RoleCurrency.cs
Normal file
15
Entity/Game/Role/Child/RoleCurrency.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Fantasy.Entitas;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using MongoDB.Bson.Serialization.Options;
|
||||
|
||||
namespace NB;
|
||||
|
||||
/// <summary>
|
||||
/// 角色货币数据
|
||||
/// </summary>
|
||||
[RoleCom]
|
||||
public class RoleCurrency : Entity
|
||||
{
|
||||
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
|
||||
public Dictionary<int, int> dic = new();
|
||||
}
|
||||
11
Entity/Game/Role/Child/RoleDayFlags.cs
Normal file
11
Entity/Game/Role/Child/RoleDayFlags.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB;
|
||||
|
||||
/// <summary>
|
||||
/// 角色状态标志量
|
||||
/// </summary>
|
||||
[RoleCom]
|
||||
public class RoleDayFlags : Entity
|
||||
{
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Game;
|
||||
namespace NB;
|
||||
|
||||
public class UserStatisticsInfo : Entity
|
||||
/// <summary>
|
||||
/// 角色统计数据
|
||||
/// </summary>
|
||||
[RoleCom]
|
||||
public class RoleStatistics : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录次数
|
||||
@@ -24,5 +28,8 @@ public class UserStatisticsInfo : Entity
|
||||
/// </summary>
|
||||
public long CreateTime;
|
||||
|
||||
/// <summary>
|
||||
/// 钓鱼个数
|
||||
/// </summary>
|
||||
public int FishCount;
|
||||
}
|
||||
8
Entity/Game/Role/Role.cs
Normal file
8
Entity/Game/Role/Role.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB;
|
||||
|
||||
public sealed class Role : Entity
|
||||
{
|
||||
|
||||
}
|
||||
10
Entity/Game/Role/RoleComAttribute.cs
Normal file
10
Entity/Game/Role/RoleComAttribute.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using CommandLine;
|
||||
|
||||
namespace NB;
|
||||
|
||||
/// <summary>
|
||||
/// 挂这个 玩家Role创建时会自动添加此组件
|
||||
/// </summary>
|
||||
public class RoleComAttribute : BaseAttribute
|
||||
{
|
||||
}
|
||||
8
Entity/Game/Role/RoleManagerComponent.cs
Normal file
8
Entity/Game/Role/RoleManagerComponent.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB;
|
||||
|
||||
public class RoleManagerComponent : Entity
|
||||
{
|
||||
public readonly Dictionary<long, Role> Roles = new();
|
||||
}
|
||||
Reference in New Issue
Block a user