private void LogReaderOnCardMovement(HsLogReader sender, CardMovementArgs args) { Dispatcher.BeginInvoke(new Action(() => { switch (args.MovementType) { case CardMovementType.PlayerGet: HandlePlayerGet(args.CardId); break; case CardMovementType.PlayerDraw: HandlePlayerDraw(args.CardId); break; case CardMovementType.PlayerMulligan: HandlePlayerMulligan(args.CardId); break; case CardMovementType.PlayerHandDiscard: HandlePlayerHandDiscard(args.CardId); break; case CardMovementType.PlayerPlay: HandlePlayerPlay(args.CardId); break; case CardMovementType.PlayerDeckDiscard: HandlePlayerDeckDiscard(args.CardId); break; case CardMovementType.OpponentSecretTrigger: HandleOpponentSecretTrigger(args.CardId); break; case CardMovementType.OpponentPlay: HandleOpponentPlay(args.CardId); break; case CardMovementType.OpponentMulligan: HandleOpponentMulligan(); break; case CardMovementType.OpponentHandDiscard: HandleOpponentHandDiscard(); break; case CardMovementType.OpponentDraw: HandleOpponentDraw(); break; case CardMovementType.OpponentDeckDiscard: HandleOpponentDeckDiscard(); break; case CardMovementType.OpponentPlayToHand: HandleOpponentPlayToHand(args.CardId); break; default: Console.WriteLine("Invalid card movement"); break; } })); }
private void LogReaderOnCardMovement(HsLogReader sender, CardMovementArgs args) { Logger.WriteLine(string.Format("{0} (id:{1} turn:{2} from:{3})", args.MovementType.ToString(), args.CardId, sender.GetTurnNumber(), args.From), "LogReader"); switch (args.MovementType) { case CardMovementType.PlayerGet: HandlePlayerGet(args.CardId); break; case CardMovementType.PlayerDraw: HandlePlayerDraw(args.CardId); break; case CardMovementType.PlayerMulligan: HandlePlayerMulligan(args.CardId); break; case CardMovementType.PlayerHandDiscard: HandlePlayerHandDiscard(args.CardId); break; case CardMovementType.PlayerPlay: HandlePlayerPlay(args.CardId); break; case CardMovementType.PlayerDeckDiscard: HandlePlayerDeckDiscard(args.CardId); break; case CardMovementType.OpponentSecretTrigger: HandleOpponentSecretTrigger(args.CardId); break; case CardMovementType.OpponentPlay: //moved to CardPosChange break; case CardMovementType.OpponentHandDiscard: //moved to CardPosChange (included in play) break; case CardMovementType.OpponentDeckDiscard: HandleOpponentDeckDiscard(args.CardId); break; case CardMovementType.OpponentPlayToHand: HandleOpponentPlayToHand(args.CardId, sender.GetTurnNumber()); break; default: Logger.WriteLine("Invalid card movement"); break; } }