修改提交
This commit is contained in:
63
Assets/Scripts/Fishing/New/Data/MapRoom.cs
Normal file
63
Assets/Scripts/Fishing/New/Data/MapRoom.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
/// <summary>
|
||||
/// 地图房间
|
||||
/// </summary>
|
||||
public class MapRoom : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否本地房间
|
||||
/// </summary>
|
||||
public bool IsLocalRoom;
|
||||
|
||||
/// <summary>
|
||||
/// 房间序号id
|
||||
/// </summary>
|
||||
public int RoomId;
|
||||
|
||||
/// <summary>
|
||||
/// 房间代码
|
||||
/// </summary>
|
||||
public string Code = string.Empty;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 房间玩家
|
||||
/// </summary>
|
||||
public Dictionary<long, Player> Units = new Dictionary<long, Player>();
|
||||
|
||||
/// <summary>
|
||||
/// 房主
|
||||
/// </summary>
|
||||
public long Owner;
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public long CreateTime;
|
||||
|
||||
/// <summary>
|
||||
/// 房间地图
|
||||
/// </summary>
|
||||
public int Map;
|
||||
|
||||
public void AddUnit(MapUnitInfo unit)
|
||||
{
|
||||
var player = Create<Player>(Game.Main, unit.Id, true, true);
|
||||
Units[unit.Id] = player;
|
||||
player.InitPlayer(unit);
|
||||
}
|
||||
|
||||
public void RemoveUnit(long id)
|
||||
{
|
||||
if (Units.Remove(id, out var player))
|
||||
{
|
||||
player.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user