示例#1
0
    public void ChangeState(EntityBase entity, EnityState newState, params object[] args)
    {
        if (entity.CurState == newState)
        {
            return;
        }

        if (fsmDic.ContainsKey(newState))
        {
            if (entity.CurState != EnityState.None)
            {
                fsmDic[entity.CurState].Exit(entity, args);
            }
            fsmDic[newState].Enter(entity, args);
            fsmDic[newState].Process(entity, args);
        }
    }
示例#2
0
 //public string Log()
 //{
 //	var logString = CustomerID + ": " +
 //					FullName + ": " +
 //					"Email: " + Email + ": " +
 //					"Status: " + EnityState.ToString();
 //	return logString;
 //}
 //same with lambda operator:
 public string Log() =>
 $"{CustomerID}: {FullName} Email: {Email} Status: {EnityState.ToString()}";
示例#3
0
 public string Log() =>
 $"{ProductID}: {ProductName} Detail: {ProductDescription} Status: {EnityState.ToString()}";