Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
windbot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HiiragiGuardians
windbot
Commits
d409521b
Commit
d409521b
authored
Aug 07, 2024
by
Swerik
Committed by
GitHub
Aug 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flip highest and lowest attack/defense monsters (#201)
parent
5eb4766a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Game/AI/CardContainer.cs
Game/AI/CardContainer.cs
+8
-4
No files found.
Game/AI/CardContainer.cs
View file @
d409521b
...
...
@@ -55,28 +55,32 @@ namespace WindBot.Game.AI
{
return
cards
.
Where
(
card
=>
card
?.
Data
!=
null
&&
card
.
HasType
(
CardType
.
Monster
)
&&
card
.
IsFaceup
()
&&
!(
canBeTarget
&&
card
.
IsShouldNotBeTarget
()))
.
OrderBy
(
card
=>
card
.
Attack
).
FirstOrDefault
();
.
OrderByDescending
(
card
=>
card
.
Attack
)
.
FirstOrDefault
();
}
public
static
ClientCard
GetHighestDefenseMonster
(
this
IEnumerable
<
ClientCard
>
cards
,
bool
canBeTarget
=
false
)
{
return
cards
.
Where
(
card
=>
card
?.
Data
!=
null
&&
card
.
HasType
(
CardType
.
Monster
)
&&
card
.
IsFaceup
()
&&
!(
canBeTarget
&&
card
.
IsShouldNotBeTarget
()))
.
OrderBy
(
card
=>
card
.
Defense
).
FirstOrDefault
();
.
OrderByDescending
(
card
=>
card
.
Defense
)
.
FirstOrDefault
();
}
public
static
ClientCard
GetLowestAttackMonster
(
this
IEnumerable
<
ClientCard
>
cards
,
bool
canBeTarget
=
false
)
{
return
cards
.
Where
(
card
=>
card
?.
Data
!=
null
&&
card
.
HasType
(
CardType
.
Monster
)
&&
card
.
IsFaceup
()
&&
!(
canBeTarget
&&
card
.
IsShouldNotBeTarget
()))
.
OrderByDescending
(
card
=>
card
.
Attack
).
FirstOrDefault
();
.
OrderBy
(
card
=>
card
.
Attack
)
.
FirstOrDefault
();
}
public
static
ClientCard
GetLowestDefenseMonster
(
this
IEnumerable
<
ClientCard
>
cards
,
bool
canBeTarget
=
false
)
{
return
cards
.
Where
(
card
=>
card
?.
Data
!=
null
&&
card
.
HasType
(
CardType
.
Monster
)
&&
card
.
IsFaceup
()
&&
!(
canBeTarget
&&
card
.
IsShouldNotBeTarget
()))
.
OrderByDescending
(
card
=>
card
.
Defense
).
FirstOrDefault
();
.
OrderBy
(
card
=>
card
.
Defense
)
.
FirstOrDefault
();
}
public
static
bool
ContainsMonsterWithLevel
(
this
IEnumerable
<
ClientCard
>
cards
,
int
level
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment