房间创建和进入相关逻辑和协议
This commit is contained in:
8
Entity/Map/Component/MapManageComponent.cs
Normal file
8
Entity/Map/Component/MapManageComponent.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Map;
|
||||
|
||||
public class MapManageComponent: Entity
|
||||
{
|
||||
public readonly Dictionary<long, Map> Maps = new();
|
||||
}
|
||||
8
Entity/Map/Component/MapUnitManageComponent.cs
Normal file
8
Entity/Map/Component/MapUnitManageComponent.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Map;
|
||||
|
||||
public class MapUnitManageComponent : Entity
|
||||
{
|
||||
public readonly Dictionary<long, MapUnit> Units = new();
|
||||
}
|
||||
11
Entity/Map/Component/RoomManageComponent.cs
Normal file
11
Entity/Map/Component/RoomManageComponent.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Map;
|
||||
|
||||
public class RoomManageComponent : Entity
|
||||
{
|
||||
public readonly Dictionary<long, MapRoom> Rooms = new();
|
||||
|
||||
public readonly PriorityQueue<int, int> FreeIds = new();
|
||||
public readonly HashSet<int> InUseID = new();
|
||||
}
|
||||
7
Entity/Map/Entity/Map.cs
Normal file
7
Entity/Map/Entity/Map.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Map;
|
||||
|
||||
public class Map : Entity
|
||||
{
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy.Entitas;
|
||||
using NB.Map;
|
||||
|
||||
namespace NB.Map;
|
||||
|
||||
@@ -7,10 +8,20 @@ namespace NB.Map;
|
||||
/// </summary>
|
||||
public class MapRoom : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 房间序号id
|
||||
/// </summary>
|
||||
public int RoomId;
|
||||
|
||||
/// <summary>
|
||||
/// 房间代码
|
||||
/// </summary>
|
||||
public string Code = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 房间密码
|
||||
/// </summary>
|
||||
public string Password;
|
||||
public string Password = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 房间玩家
|
||||
@@ -17,4 +17,16 @@ public class MapUnit : Entity
|
||||
/// 旋转
|
||||
/// </summary>
|
||||
public float4 Rotation;
|
||||
|
||||
/// <summary>
|
||||
/// 当前所在地图id
|
||||
/// </summary>
|
||||
public int MapId;
|
||||
|
||||
/// <summary>
|
||||
/// 当前所在房间id
|
||||
/// </summary>
|
||||
public int RoomId;
|
||||
|
||||
public long GateRouteId;
|
||||
}
|
||||
Reference in New Issue
Block a user