/// <summary> /// 启动结算 /// </summary> /// <param name="Name">添加的操作名</param> /// <param name="action">添加的操作方法</param> public void StartSettle(PSettle Settle) { SettleRecord NewSettleRecord = new SettleRecord(Settle); lock (SettleRecordStack) { SettleRecordStack.Push(NewSettleRecord); } PLogger.Log("开始结算 " + Settle.Name); NewSettleRecord.Settle.SettleAction(Game); //NewSettleRecord.ActionThread.Start(); //PThread.WaitUntil(() => NewSettleRecord.Finished); PLogger.Log("终止结算 " + Settle.Name); //if (NewSettleRecord.ActionThread.IsAlive) { // NewSettleRecord.ActionThread.Abort(); //} lock (SettleRecordStack) { if (SettleRecordStack.Count > 0 && NewSettleRecord.Equals(SettleRecordStack.Peek())) { SettleRecordStack.Pop(); } } }
public void StartLogic(PSettle Settle) { (LogicThread = new Thread(() => { StartSettle(Settle); })).Start(); }
public SettleRecord(PSettle _Settle) { Settle = _Settle; Finished = false; }