Commit e7486c04 authored by mercury233's avatar mercury233

use IList if possible

parent 5e56e903
...@@ -351,7 +351,7 @@ namespace WindBot.Game.AI.Decks ...@@ -351,7 +351,7 @@ namespace WindBot.Game.AI.Decks
// Let Azure-Eyes spsummon first // Let Azure-Eyes spsummon first
return false; return false;
} }
List<int> targets = new List<int> { IList<int> targets = new[] {
CardId.HopeHarbingerDragonTitanicGalaxy, CardId.HopeHarbingerDragonTitanicGalaxy,
CardId.GalaxyEyesDarkMatterDragon, CardId.GalaxyEyesDarkMatterDragon,
CardId.AlternativeWhiteDragon, CardId.AlternativeWhiteDragon,
...@@ -391,7 +391,7 @@ namespace WindBot.Game.AI.Decks ...@@ -391,7 +391,7 @@ namespace WindBot.Game.AI.Decks
private bool SageWithEyesOfBlueSummon() private bool SageWithEyesOfBlueSummon()
{ {
return !Bot.HasInHand(new List<int> return !Bot.HasInHand(new[]
{ {
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend CardId.WhiteStoneOfLegend
...@@ -424,11 +424,11 @@ namespace WindBot.Game.AI.Decks ...@@ -424,11 +424,11 @@ namespace WindBot.Game.AI.Decks
{ {
return false; return false;
} }
if (!Bot.HasInMonstersZone(new List<int> if (!Bot.HasInMonstersZone(new[]
{ {
CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients CardId.WhiteStoneOfAncients
}) || Bot.HasInMonstersZone(new List<int> }) || Bot.HasInMonstersZone(new[]
{ {
CardId.AlternativeWhiteDragon, CardId.AlternativeWhiteDragon,
CardId.WhiteDragon, CardId.WhiteDragon,
...@@ -568,7 +568,7 @@ namespace WindBot.Game.AI.Decks ...@@ -568,7 +568,7 @@ namespace WindBot.Game.AI.Decks
private bool WhiteStoneSummon() private bool WhiteStoneSummon()
{ {
return Bot.HasInMonstersZone(new List<int> return Bot.HasInMonstersZone(new[]
{ {
CardId.SageWithEyesOfBlue, CardId.SageWithEyesOfBlue,
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
...@@ -865,7 +865,7 @@ namespace WindBot.Game.AI.Decks ...@@ -865,7 +865,7 @@ namespace WindBot.Game.AI.Decks
{ {
return true; return true;
} }
if (Duel.Phase == DuelPhase.Main1 && !Bot.HasInMonstersZone(new List<int> if (Duel.Phase == DuelPhase.Main1 && !Bot.HasInMonstersZone(new[]
{ {
CardId.AlternativeWhiteDragon, CardId.AlternativeWhiteDragon,
CardId.WhiteDragon, CardId.WhiteDragon,
...@@ -978,7 +978,7 @@ namespace WindBot.Game.AI.Decks ...@@ -978,7 +978,7 @@ namespace WindBot.Game.AI.Decks
private bool CanDealWithUsedAlternativeWhiteDragon() private bool CanDealWithUsedAlternativeWhiteDragon()
{ {
return Bot.HasInMonstersZone(new List<int> return Bot.HasInMonstersZone(new[]
{ {
CardId.SageWithEyesOfBlue, CardId.SageWithEyesOfBlue,
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
......
...@@ -96,7 +96,7 @@ namespace WindBot.Game.AI.Decks ...@@ -96,7 +96,7 @@ namespace WindBot.Game.AI.Decks
private bool Capsule() private bool Capsule()
{ {
List<int> SelectedCard = new List<int>(); IList<int> SelectedCard = new List<int>();
SelectedCard.Add(CardId.PowerBond); SelectedCard.Add(CardId.PowerBond);
SelectedCard.Add(CardId.DarkHole); SelectedCard.Add(CardId.DarkHole);
SelectedCard.Add(CardId.Raigeki); SelectedCard.Add(CardId.Raigeki);
......
...@@ -33,12 +33,12 @@ namespace WindBot.Game.AI.Decks ...@@ -33,12 +33,12 @@ namespace WindBot.Game.AI.Decks
bool CardOfDemiseUsed = false; bool CardOfDemiseUsed = false;
List<int> LowScaleCards = new List<int> IList<int> LowScaleCards = new[]
{ {
CardId.Stealth, CardId.Stealth,
CardId.Carrier CardId.Carrier
}; };
List<int> HighScaleCards = new List<int> IList<int> HighScaleCards = new[]
{ {
CardId.Scout, CardId.Scout,
CardId.Shell, CardId.Shell,
......
...@@ -212,7 +212,7 @@ namespace WindBot.Game.AI.Decks ...@@ -212,7 +212,7 @@ namespace WindBot.Game.AI.Decks
private bool MonsterRebornEffect() private bool MonsterRebornEffect()
{ {
List<int> targets = new List<int> { IList<int> targets = new[] {
CardId.DecodeTalker, CardId.DecodeTalker,
CardId.EncodeTalker, CardId.EncodeTalker,
CardId.TriGateWizard, CardId.TriGateWizard,
...@@ -336,7 +336,7 @@ namespace WindBot.Game.AI.Decks ...@@ -336,7 +336,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Removed) if (Card.Location == CardLocation.Removed)
return true; return true;
bool hastarget = Bot.HasInHand(new List<int> { bool hastarget = Bot.HasInHand(new[] {
CardId.Draconnet, CardId.Draconnet,
CardId.Kleinant, CardId.Kleinant,
CardId.BalancerLord, CardId.BalancerLord,
...@@ -354,7 +354,7 @@ namespace WindBot.Game.AI.Decks ...@@ -354,7 +354,7 @@ namespace WindBot.Game.AI.Decks
private bool ROMCloudiaSummon() private bool ROMCloudiaSummon()
{ {
return Bot.HasInGraveyard(new List<int> { return Bot.HasInGraveyard(new[] {
CardId.BootStagguard, CardId.BootStagguard,
CardId.BalancerLord, CardId.BalancerLord,
CardId.Kleinant, CardId.Kleinant,
......
...@@ -124,11 +124,11 @@ namespace WindBot.Game.AI.Decks ...@@ -124,11 +124,11 @@ namespace WindBot.Game.AI.Decks
private bool MedallionOfTheIceBarrierEffect() private bool MedallionOfTheIceBarrierEffect()
{ {
if (Bot.HasInHand(new List<int> if (Bot.HasInHand(new[]
{ {
CardId.CryomancerOfTheIceBarrier, CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier CardId.DewdarkOfTheIceBarrier
}) || Bot.HasInMonstersZone(new List<int> }) || Bot.HasInMonstersZone(new[]
{ {
CardId.CryomancerOfTheIceBarrier, CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier CardId.DewdarkOfTheIceBarrier
...@@ -308,7 +308,7 @@ namespace WindBot.Game.AI.Decks ...@@ -308,7 +308,7 @@ namespace WindBot.Game.AI.Decks
{ {
// negate effect, select a cost for it // negate effect, select a cost for it
List<ClientCard> monsters = Bot.GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
List<int> suitableCost = new List<int> { IList<int> suitableCost = new[] {
CardId.SwapFrog, CardId.SwapFrog,
CardId.Ronintoadin, CardId.Ronintoadin,
CardId.GraydleSlimeJr, CardId.GraydleSlimeJr,
...@@ -420,7 +420,7 @@ namespace WindBot.Game.AI.Decks ...@@ -420,7 +420,7 @@ namespace WindBot.Game.AI.Decks
{ {
bool should = Bot.HasInMonstersZone(CardId.ToadallyAwesome) bool should = Bot.HasInMonstersZone(CardId.ToadallyAwesome)
&& ((AI.Utils.IsOneEnemyBetter(true) && ((AI.Utils.IsOneEnemyBetter(true)
&& !Bot.HasInMonstersZone(new List<int> && !Bot.HasInMonstersZone(new[]
{ {
CardId.CatShark, CardId.CatShark,
CardId.SkyCavalryCentaurea CardId.SkyCavalryCentaurea
...@@ -481,7 +481,7 @@ namespace WindBot.Game.AI.Decks ...@@ -481,7 +481,7 @@ namespace WindBot.Game.AI.Decks
return AI.Utils.IsOneEnemyBetter(true) return AI.Utils.IsOneEnemyBetter(true)
&& AI.Utils.GetBestAttack(Enemy) > 2200 && AI.Utils.GetBestAttack(Enemy) > 2200
&& num < 4 && num < 4
&& !Bot.HasInMonstersZone(new List<int> && !Bot.HasInMonstersZone(new[]
{ {
CardId.SkyCavalryCentaurea CardId.SkyCavalryCentaurea
}, true, true); }, true, true);
......
...@@ -260,7 +260,7 @@ namespace WindBot.Game.AI.Decks ...@@ -260,7 +260,7 @@ namespace WindBot.Game.AI.Decks
private bool SolarWindJammer() private bool SolarWindJammer()
{ {
if (!Bot.HasInHand(new List<int> { if (!Bot.HasInHand(new[] {
CardId.StarDrawing, CardId.StarDrawing,
CardId.InstantFusion CardId.InstantFusion
})) }))
......
...@@ -306,7 +306,7 @@ namespace WindBot.Game.AI.Decks ...@@ -306,7 +306,7 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
if (Bot.HasInMonstersZone(CardId.Thoroughblade) && !TigermortarSpsummoned if (Bot.HasInMonstersZone(CardId.Thoroughblade) && !TigermortarSpsummoned
&& Bot.HasInGraveyard(new List<int> && Bot.HasInGraveyard(new[]
{ {
CardId.Whiptail, CardId.Whiptail,
CardId.Ratpier CardId.Ratpier
......
...@@ -104,7 +104,7 @@ namespace WindBot.Game ...@@ -104,7 +104,7 @@ namespace WindBot.Game
return HasInCards(Hand, cardId); return HasInCards(Hand, cardId);
} }
public bool HasInHand(List<int> cardId) public bool HasInHand(IList<int> cardId)
{ {
return HasInCards(Hand, cardId); return HasInCards(Hand, cardId);
} }
...@@ -114,7 +114,7 @@ namespace WindBot.Game ...@@ -114,7 +114,7 @@ namespace WindBot.Game
return HasInCards(Graveyard, cardId); return HasInCards(Graveyard, cardId);
} }
public bool HasInGraveyard(List<int> cardId) public bool HasInGraveyard(IList<int> cardId)
{ {
return HasInCards(Graveyard, cardId); return HasInCards(Graveyard, cardId);
} }
...@@ -124,7 +124,7 @@ namespace WindBot.Game ...@@ -124,7 +124,7 @@ namespace WindBot.Game
return HasInCards(Banished, cardId); return HasInCards(Banished, cardId);
} }
public bool HasInBanished(List<int> cardId) public bool HasInBanished(IList<int> cardId)
{ {
return HasInCards(Banished, cardId); return HasInCards(Banished, cardId);
} }
...@@ -134,7 +134,7 @@ namespace WindBot.Game ...@@ -134,7 +134,7 @@ namespace WindBot.Game
return HasInCards(ExtraDeck, cardId); return HasInCards(ExtraDeck, cardId);
} }
public bool HasInExtra(List<int> cardId) public bool HasInExtra(IList<int> cardId)
{ {
return HasInCards(ExtraDeck, cardId); return HasInCards(ExtraDeck, cardId);
} }
...@@ -166,7 +166,7 @@ namespace WindBot.Game ...@@ -166,7 +166,7 @@ namespace WindBot.Game
return HasInCards(MonsterZone, cardId, notDisabled, hasXyzMaterial); return HasInCards(MonsterZone, cardId, notDisabled, hasXyzMaterial);
} }
public bool HasInMonstersZone(List<int> cardId, bool notDisabled = false, bool hasXyzMaterial = false) public bool HasInMonstersZone(IList<int> cardId, bool notDisabled = false, bool hasXyzMaterial = false)
{ {
return HasInCards(MonsterZone, cardId, notDisabled, hasXyzMaterial); return HasInCards(MonsterZone, cardId, notDisabled, hasXyzMaterial);
} }
...@@ -176,7 +176,7 @@ namespace WindBot.Game ...@@ -176,7 +176,7 @@ namespace WindBot.Game
return HasInCards(SpellZone, cardId, notDisabled); return HasInCards(SpellZone, cardId, notDisabled);
} }
public bool HasInSpellZone(List<int> cardId, bool notDisabled = false) public bool HasInSpellZone(IList<int> cardId, bool notDisabled = false)
{ {
return HasInCards(SpellZone, cardId, notDisabled); return HasInCards(SpellZone, cardId, notDisabled);
} }
...@@ -264,7 +264,7 @@ namespace WindBot.Game ...@@ -264,7 +264,7 @@ namespace WindBot.Game
return false; return false;
} }
private static bool HasInCards(IEnumerable<ClientCard> cards, List<int> cardId, bool notDisabled = false, bool hasXyzMaterial = false) private static bool HasInCards(IEnumerable<ClientCard> cards, IList<int> cardId, bool notDisabled = false, bool hasXyzMaterial = false)
{ {
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment