Commit e7486c04 authored by mercury233's avatar mercury233

use IList if possible

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