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); } }
//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()}";
public string Log() => $"{ProductID}: {ProductName} Detail: {ProductDescription} Status: {EnityState.ToString()}";