public Card SpecialCard(string id) { Card card; SpecialCards.TryGetValue(id, out card); return(card); }
public void SpecialEmptyTest() { special = new BiYak(null); int point = 0; var collection = new Object(); special.CollectionEmpty += (s, e) => { collection = s; point = ((SpecialEmptyEventArgs)e).Points; }; Assert.AreEqual(20, point); Assert.IsInstanceOfType(collection, typeof(SpecialCards)); }
public override void Behave(Desk desk) { var specialCard = SpecialCards.PickOne(); if (!(specialCard is CardCY)) { desk.AddMessageLine($"Cy牌: 表达出{specialCard.ShortName}: {specialCard.Description}"); } specialCard.Behave(desk); }
private void VerifySpecialCards() { if (SpecialCards == null) { SpecialCards = new Dictionary <string, Card>(); } if (!SpecialCards.ContainsKey("gameover_coal")) { SpecialCards.Add("gameover_coal", new Card("The city runs out of coal to run the generator, and freezes over.", "", "", _defaultGameOverCharacter, new GameOverOutcome(), new GameOverOutcome(), null)); } if (!SpecialCards.ContainsKey("gameover_food")) { SpecialCards.Add("gameover_food", new Card("Hunger consumes the city, as food reserves deplete.", "", "", _defaultGameOverCharacter, new GameOverOutcome(), new GameOverOutcome(), null)); } if (!SpecialCards.ContainsKey("gameover_health")) { SpecialCards.Add("gameover_health", new Card("The city's population succumbs to wounds and spreading diseases.", "", "", _defaultGameOverCharacter, new GameOverOutcome(), new GameOverOutcome(), null)); } if (!SpecialCards.ContainsKey("gameover_hope")) { SpecialCards.Add("gameover_hope", new Card("All hope among the people is lost.", "", "", _defaultGameOverCharacter, new GameOverOutcome(), new GameOverOutcome(), null)); } }