Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygo-agent
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
Biluo Shen
ygo-agent
Commits
66ebb5af
Commit
66ebb5af
authored
May 02, 2024
by
sbl1996@126.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more error message and fallback for ms_spec not found
parent
63aac472
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
ygoenv/ygoenv/ygopro/ygopro.h
ygoenv/ygoenv/ygopro/ygopro.h
+18
-6
No files found.
ygoenv/ygoenv/ygopro/ygopro.h
View file @
66ebb5af
...
@@ -1737,6 +1737,9 @@ public:
...
@@ -1737,6 +1737,9 @@ public:
}
}
}
}
if
(
ms_idx_
==
ms_max_
-
1
)
{
if
(
ms_idx_
==
ms_max_
-
1
)
{
if
(
ms_idx_
>=
ms_min_
)
{
options_
.
push_back
(
"f"
);
}
callback_
=
[
this
](
int
idx
)
{
callback_
=
[
this
](
int
idx
)
{
_callback_multi_select
(
idx
,
true
);
_callback_multi_select
(
idx
,
true
);
};
};
...
@@ -1769,13 +1772,14 @@ public:
...
@@ -1769,13 +1772,14 @@ public:
show_deck
(
1
);
show_deck
(
1
);
show_buffer
();
show_buffer
();
show_turn
();
show_turn
();
fmt
::
println
(
"MS: idx: {}, mode: {}, min: {}, max: {}, must: {}, specs: {}, combs: {}
"
,
ms_idx_
,
ms_mode_
,
ms_min_
,
ms_max_
,
ms_must_
,
ms_specs_
,
ms_comb
s_
);
fmt
::
println
(
"MS: idx: {}, mode: {}, min: {}, max: {}, must: {}, specs: {}, combs: {}
, r_idx: {}"
,
ms_idx_
,
ms_mode_
,
ms_min_
,
ms_max_
,
ms_must_
,
ms_specs_
,
ms_combs_
,
ms_r_idx
s_
);
fmt
::
print
(
"ms_spec2idx: "
);
fmt
::
print
(
"ms_spec2idx: "
);
for
(
const
auto
&
[
k
,
v
]
:
ms_spec2idx_
)
{
for
(
const
auto
&
[
k
,
v
]
:
ms_spec2idx_
)
{
fmt
::
print
(
"({}, {}), "
,
k
,
v
);
fmt
::
print
(
"({}, {}), "
,
k
,
v
);
}
}
fmt
::
print
(
"
\n
"
);
fmt
::
print
(
"
\n
"
);
throw
std
::
runtime_error
(
"Spec not found: "
+
spec
);
return
-
1
;
// throw std::runtime_error("Spec not found: " + spec);
}
}
void
_callback_multi_select_2
(
int
idx
)
{
void
_callback_multi_select_2
(
int
idx
)
{
...
@@ -1828,7 +1832,15 @@ public:
...
@@ -1828,7 +1832,15 @@ public:
finish
=
true
;
finish
=
true
;
}
else
{
}
else
{
idx
=
get_ms_spec_idx
(
option
);
idx
=
get_ms_spec_idx
(
option
);
ms_r_idxs_
.
push_back
(
idx
);
if
(
idx
!=
-
1
)
{
ms_r_idxs_
.
push_back
(
idx
);
}
else
{
// TODO: find the root cause
fmt
::
println
(
"options: {}, idx: {}, option: {}"
,
options_
,
idx
,
option
);
if
(
std
::
find
(
options_
.
begin
(),
options_
.
end
(),
"f"
)
!=
options_
.
end
())
{
finish
=
true
;
}
}
}
}
if
(
finish
)
{
if
(
finish
)
{
ms_idx_
=
-
1
;
ms_idx_
=
-
1
;
...
@@ -1883,9 +1895,9 @@ public:
...
@@ -1883,9 +1895,9 @@ public:
}
}
void
show_deck
(
PlayerId
player
)
const
{
void
show_deck
(
PlayerId
player
)
const
{
fmt
::
print
(
"Player {}'s deck:
\n
"
,
player
);
fmt
::
print
(
"Player {}'s deck:
{}
\n
"
,
player
,
deck_name_
[
player
]
);
show_deck
(
player
==
0
?
main_deck0_
:
main_deck1_
,
"Main"
);
//
show_deck(player == 0 ? main_deck0_ : main_deck1_, "Main");
show_deck
(
player
==
0
?
extra_deck0_
:
extra_deck1_
,
"Extra"
);
//
show_deck(player == 0 ? extra_deck0_ : extra_deck1_, "Extra");
}
}
void
show_history_actions
(
PlayerId
player
)
const
{
void
show_history_actions
(
PlayerId
player
)
const
{
...
...
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