Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
Windbot-408
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
神之吹息
Windbot-408
Commits
80cbd224
Commit
80cbd224
authored
Mar 13, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change side
parent
a87c4681
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
Game/GameBehavior.cs
Game/GameBehavior.cs
+15
-2
No files found.
Game/GameBehavior.cs
View file @
80cbd224
...
@@ -16,6 +16,8 @@ namespace WindBot.Game
...
@@ -16,6 +16,8 @@ namespace WindBot.Game
public
GameClient
Game
{
get
;
private
set
;
}
public
GameClient
Game
{
get
;
private
set
;
}
public
YGOClient
Connection
{
get
;
private
set
;
}
public
YGOClient
Connection
{
get
;
private
set
;
}
public
Deck
Deck
{
get
;
private
set
;
}
public
Deck
Deck
{
get
;
private
set
;
}
public
Deck
DeckForWin
{
get
;
private
set
;
}
public
Deck
DeckForLose
{
get
;
private
set
;
}
private
GameAI
_ai
;
private
GameAI
_ai
;
...
@@ -46,7 +48,8 @@ namespace WindBot.Game
...
@@ -46,7 +48,8 @@ namespace WindBot.Game
_ai
=
new
GameAI
(
Game
,
_duel
);
_ai
=
new
GameAI
(
Game
,
_duel
);
_ai
.
Executor
=
DecksManager
.
Instantiate
(
_ai
,
_duel
);
_ai
.
Executor
=
DecksManager
.
Instantiate
(
_ai
,
_duel
);
Deck
=
Deck
.
Load
(
_ai
.
Executor
.
Deck
);
Deck
=
Deck
.
Load
(
_ai
.
Executor
.
Deck
);
DeckForWin
=
Deck
.
Load
(
"Win/"
+
_ai
.
Executor
.
Deck
);
DeckForLose
=
Deck
.
Load
(
"Lose/"
+
_ai
.
Executor
.
Deck
);
_select_hint
=
0
;
_select_hint
=
0
;
lastDuelResult
=
2
;
lastDuelResult
=
2
;
}
}
...
@@ -171,10 +174,20 @@ namespace WindBot.Game
...
@@ -171,10 +174,20 @@ namespace WindBot.Game
Connection
.
Send
(
deck
);
Connection
.
Send
(
deck
);
_ai
.
OnJoinGame
();
_ai
.
OnJoinGame
();
}
}
private
Deck
pickDeckOnResult
()
{
if
(
lastDuelResult
==
0
&&
DeckForWin
!=
null
)
{
return
DeckForWin
;
}
if
(
lastDuelResult
==
1
&&
DeckForLose
!=
null
)
{
return
DeckForLose
;
}
return
Deck
;
}
private
void
OnChangeSide
(
BinaryReader
packet
)
private
void
OnChangeSide
(
BinaryReader
packet
)
{
{
BinaryWriter
deck
=
buildUpdateDeck
(
Deck
);
BinaryWriter
deck
=
buildUpdateDeck
(
pickDeckOnResult
()
);
Connection
.
Send
(
deck
);
Connection
.
Send
(
deck
);
_ai
.
OnJoinGame
();
_ai
.
OnJoinGame
();
}
}
...
...
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