using System;
using MessagePack;
using Newtonsoft.Json;

namespace GlobalSever.FSM
{
    /// <summary>
    /// 状态机内存数据
    /// </summary>
    [Serializable]
    [MessagePackObject]
    public class FSMMem
    {
        [Key(0)]
        public int NowStateId { get; set; }
        
        /// <summary>
        /// 当前运行的状态 (也可能是即将切换的状态)
        /// </summary>
        [JsonIgnore]
        [IgnoreMember]
        public Type NowStateType { get; set; }
        
        /// <summary>
        /// 延迟切换时间 （毫秒）
        /// </summary>
        [IgnoreMember]
        [JsonIgnore]
        public int NowChangeDelayTime { get; internal set; }
        
        [JsonIgnore]
        [IgnoreMember]
        public int RunDuratime { get; internal set; }
        
        [JsonIgnore]
        [IgnoreMember]
        public int LastUpdateTime { get; internal set; }

        [JsonIgnore] 
        [IgnoreMember]
        public bool NeedChange { get; internal set; } = false;
    }
}