XNet/XNet.Business/Entity/ControlPlayer.cs
2025-12-31 18:29:29 +08:00

153 lines
4.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using DotRecast.Detour.Crowd;
using System.Collections.Concurrent;
using System.Net.WebSockets;
using System.Numerics;
using XNet.Business.Dto;
namespace XNet.Business.Entity
{
public class ControlPlayer
{
/// <summary>
/// 用户连接ID
/// </summary>
public string PlayerId { get; set; } = string.Empty;
/// <summary>
/// 用户昵称
/// </summary>
public string NickName { get; set; } = string.Empty;
/// <summary>
/// 是否碰到非地面障碍物或者碰到其他对象,需要转向
/// </summary>
public bool IsNeedToOtherDir { get; set; } = false;
/// <summary>
/// 是否可以控制动作
/// </summary>
public bool IsCanControl { get; set; } = false;
/// <summary>
/// 是否可被击中
/// </summary>
public bool IsCanHit { get; set; } = false;
/// <summary>
/// 是否已进地图
/// </summary>
public bool IsEnterMap { get; set; } = false;
/// <summary>
/// 是否是AI
/// </summary>
public bool IsAI { get; set; } = false;
/// <summary>
/// 上一次位置计时的时候的时间用来判断AI是否走死
/// </summary>
public DateTime PrevToDirTime { get; set; } = DateTime.MinValue;
/// <summary>
/// 临时存储的位置
/// </summary>
public Vector3 TmpPos { get; set; } = new Vector3();
/// <summary>
/// 将要去的位置
/// </summary>
public Vector3 ToPos { get; set; } = new Vector3();
/// <summary>
/// 存储当前的位置
/// </summary>
public Vector3 CurrentPos { get; set; } = new Vector3();
/// <summary>
/// 临时存储的欧拉角
/// </summary>
public Vector3 TmpEuler { get; set; } = new Vector3();
/// <summary>
/// 目标欧拉角,角色朝向
/// </summary>
public Vector3 ToEuler { get; set; } = new Vector3();
/// <summary>
/// 当前线性插值欧拉角,角色朝向
/// </summary>
public Vector3 CurrentEuler { get; set; } = new Vector3();
/// <summary>
/// 索敌距离
/// </summary>
public float FindFaceDistance { get; set; } = 0;
/// <summary>
/// 车身半径
/// </summary>
public float Radius { get; set; } = 0;
/// <summary>
/// 火力
/// </summary>
public float AttackPower { get; set; } = 0;
/// <summary>
/// 护甲
/// </summary>
public float Armor { get; set; } = 0;
/// <summary>
/// 速度
/// </summary>
public float Speed { get; set; } = 0;
/// <summary>
/// 当前血量
/// </summary>
public float Blood { get; set; } = 0;
/// <summary>
/// 最大血量
/// </summary>
public float MaxBlood { get; set; } = 0;
public int BodyIdx { get; set; } = 0;
public int WeaponIdx { get; set; } = 0;
public int ArmorIdx { get; set; } = 0;
public int ChassisIdx { get; set; } = 0;
public string DeviceColor { get; set; } = "#FFFFFF";
/// <summary>
/// 随机出生点
/// </summary>
public List<Vec3> BirthPositions { get; set; } = new List<Vec3>();
public WebSocket WebSocket { get; set; } = null!;
public ConcurrentDictionary<string, bool> RoomIds { get; set; } = new();
public string FirstRoomId { get => RoomIds.Keys.FirstOrDefault()!; set => RoomIds.TryAdd(value, true); }
public string HeadImageUrl { get; set; } = string.Empty;
public byte SetIdx { get; set; }
/// <summary>
/// 路径导航索引
/// </summary>
public DtCrowdAgent Agent { get; set; } = null!;
/// <summary>
/// 1技能等级
/// </summary>
public byte Skill1Level { get; set; } = 1;
/// <summary>
/// 2技能等级
/// </summary>
public byte Skill2Level { get; set; } = 1;
/// <summary>
/// 3技能等级
/// </summary>
public byte Skill3Level { get; set; } = 1;
/// <summary>
/// 4技能等级
/// </summary>
public byte Skill4Level { get; set; } = 1;
}
}