private Phase randomPhase() { Phase phase; int r = random.Next(); switch (r % 10) { case 1: phase = new JudgePhase(randomPlayer()); break; case 2: phase = new DrawingPhase(randomPlayer()); break; case 3: phase = new ActionPhase(randomPlayer()); break; case 4: phase = new DiscardPhase(randomPlayer()); break; case 5: phase = new HarmPhase(randomPlayer(), randomPlayer(), random.Next(), randomAttack()); break; case 6: phase = new AskForHelpPhase(randomPlayer(), new HarmPhase(randomPlayer(), randomPlayer(), random.Next(), randomAttack())); break; case 7: phase = new RecoverPhase(randomPlayer(), random.Next()); break; default: phase = new DeadPhase(randomPlayer(), new HarmPhase(randomPlayer(), randomPlayer(), random.Next(), randomAttack())); break; } return(phase); }
public void getharmsource() { DeadPhase d = new DeadPhase(new ZhangFei(1), new HarmPhase(new ZhangFei(1), new LiuBei(2), 1, new Attack(CardSuit.Club, (byte)1))); Assert.IsInstanceOfType(d.harmSource, typeof(HarmPhase)); }