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
alstroemeria-silentlove
windbot
Commits
35a73da9
Commit
35a73da9
authored
May 29, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Executor.OnDraw
parent
5f585012
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
Game/AI/Executor.cs
Game/AI/Executor.cs
+5
-0
Game/GameAI.cs
Game/GameAI.cs
+8
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+1
-0
No files found.
Game/AI/Executor.cs
View file @
35a73da9
...
@@ -97,6 +97,11 @@ namespace WindBot.Game.AI
...
@@ -97,6 +97,11 @@ namespace WindBot.Game.AI
{
{
// Some AI need do something on new turn
// Some AI need do something on new turn
}
}
public
virtual
void
OnDraw
(
int
player
)
{
// Some AI need do something on draw
}
public
virtual
IList
<
ClientCard
>
OnSelectCard
(
IList
<
ClientCard
>
cards
,
int
min
,
int
max
,
int
hint
,
bool
cancelable
)
public
virtual
IList
<
ClientCard
>
OnSelectCard
(
IList
<
ClientCard
>
cards
,
int
min
,
int
max
,
int
hint
,
bool
cancelable
)
{
{
...
...
Game/GameAI.cs
View file @
35a73da9
...
@@ -70,6 +70,14 @@ namespace WindBot.Game
...
@@ -70,6 +70,14 @@ namespace WindBot.Game
return
Executor
.
OnSelectHand
();
return
Executor
.
OnSelectHand
();
}
}
/// <summary>
/// Called when any player draw card.
/// </summary>
public
void
OnDraw
(
int
player
)
{
Executor
.
OnDraw
(
player
);
}
/// <summary>
/// <summary>
/// Called when it's a new turn.
/// Called when it's a new turn.
/// </summary>
/// </summary>
...
...
Game/GameBehavior.cs
View file @
35a73da9
...
@@ -360,6 +360,7 @@ namespace WindBot.Game
...
@@ -360,6 +360,7 @@ namespace WindBot.Game
_duel
.
Fields
[
player
].
Deck
.
RemoveAt
(
_duel
.
Fields
[
player
].
Deck
.
Count
-
1
);
_duel
.
Fields
[
player
].
Deck
.
RemoveAt
(
_duel
.
Fields
[
player
].
Deck
.
Count
-
1
);
_duel
.
Fields
[
player
].
Hand
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Hand
));
_duel
.
Fields
[
player
].
Hand
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Hand
));
}
}
_ai
.
OnDraw
(
player
);
}
}
private
void
OnShuffleDeck
(
BinaryReader
packet
)
private
void
OnShuffleDeck
(
BinaryReader
packet
)
...
...
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