Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
nanahira
ygopro-core
Commits
3d8b79df
Commit
3d8b79df
authored
Sep 15, 2025
by
salix5
Committed by
GitHub
Sep 15, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor interpreter constructor and duel constructor (#794)
parent
08444f88
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
8 deletions
+5
-8
duel.cpp
duel.cpp
+1
-1
interpreter.cpp
interpreter.cpp
+1
-4
interpreter.h
interpreter.h
+3
-3
No files found.
duel.cpp
View file @
3d8b79df
...
@@ -31,8 +31,8 @@ duel::~duel() {
...
@@ -31,8 +31,8 @@ duel::~duel() {
delete
pgroup
;
delete
pgroup
;
for
(
auto
&
peffect
:
effects
)
for
(
auto
&
peffect
:
effects
)
delete
peffect
;
delete
peffect
;
delete
lua
;
delete
game_field
;
delete
game_field
;
delete
lua
;
}
}
void
duel
::
clear
()
{
void
duel
::
clear
()
{
for
(
auto
&
pcard
:
cards
)
for
(
auto
&
pcard
:
cards
)
...
...
interpreter.cpp
View file @
3d8b79df
...
@@ -14,13 +14,10 @@
...
@@ -14,13 +14,10 @@
#include "ocgapi.h"
#include "ocgapi.h"
#include "interpreter.h"
#include "interpreter.h"
interpreter
::
interpreter
(
duel
*
pd
,
bool
enable_unsafe_libraries
)
:
coroutines
(
256
)
{
interpreter
::
interpreter
(
duel
*
pd
,
bool
enable_unsafe_libraries
)
:
coroutines
(
256
),
pduel
(
pd
)
{
lua_state
=
luaL_newstate
();
lua_state
=
luaL_newstate
();
current_state
=
lua_state
;
current_state
=
lua_state
;
pduel
=
pd
;
std
::
memcpy
(
lua_getextraspace
(
lua_state
),
&
pd
,
LUA_EXTRASPACE
);
//set_duel_info
std
::
memcpy
(
lua_getextraspace
(
lua_state
),
&
pd
,
LUA_EXTRASPACE
);
//set_duel_info
no_action
=
0
;
call_depth
=
0
;
//Initial
//Initial
luaL_requiref
(
lua_state
,
"base"
,
luaopen_base
,
0
);
luaL_requiref
(
lua_state
,
"base"
,
luaopen_base
,
0
);
lua_pop
(
lua_state
,
1
);
lua_pop
(
lua_state
,
1
);
...
...
interpreter.h
View file @
3d8b79df
...
@@ -44,14 +44,14 @@ public:
...
@@ -44,14 +44,14 @@ public:
using
param_list
=
std
::
list
<
std
::
pair
<
lua_param
,
LuaParamType
>>
;
using
param_list
=
std
::
list
<
std
::
pair
<
lua_param
,
LuaParamType
>>
;
duel
*
pduel
;
duel
*
pduel
;
char
msgbuf
[
64
];
char
msgbuf
[
64
]
{}
;
lua_State
*
lua_state
;
lua_State
*
lua_state
;
lua_State
*
current_state
;
lua_State
*
current_state
;
param_list
params
;
param_list
params
;
param_list
resumes
;
param_list
resumes
;
coroutine_map
coroutines
;
coroutine_map
coroutines
;
int32_t
no_action
;
int32_t
no_action
{}
;
int32_t
call_depth
;
int32_t
call_depth
{}
;
explicit
interpreter
(
duel
*
pd
,
bool
enable_unsafe_libraries
);
explicit
interpreter
(
duel
*
pd
,
bool
enable_unsafe_libraries
);
~
interpreter
();
~
interpreter
();
...
...
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