Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
1
Merge Requests
1
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
Commits
560c5b31
Commit
560c5b31
authored
May 03, 2025
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DeckManager: update SaveDeckBuffer
parent
181afbae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
26 deletions
+15
-26
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+7
-20
gframe/deck_manager.h
gframe/deck_manager.h
+7
-1
gframe/replay.h
gframe/replay.h
+1
-5
No files found.
gframe/deck_manager.cpp
View file @
560c5b31
...
...
@@ -359,34 +359,21 @@ bool DeckManager::DeleteCategory(const wchar_t* name) {
return
false
;
return
FileSystem
::
DeleteDir
(
localname
);
}
bool
DeckManager
::
SaveDeckBuffer
(
const
int
deckbuf
[]
,
const
wchar_t
*
name
)
{
bool
DeckManager
::
SaveDeckBuffer
(
const
ReplayDeck
&
deck
,
const
wchar_t
*
name
)
{
if
(
!
FileSystem
::
IsDirExists
(
L"./deck"
)
&&
!
FileSystem
::
MakeDir
(
L"./deck"
))
return
false
;
FILE
*
fp
=
OpenDeckFile
(
name
,
"w"
);
if
(
!
fp
)
return
false
;
int
it
=
0
;
const
int
mainc
=
deckbuf
[
it
];
++
it
;
std
::
fprintf
(
fp
,
"#created by ...
\n
#main
\n
"
);
for
(
int
i
=
0
;
i
<
mainc
;
++
i
)
{
std
::
fprintf
(
fp
,
"%d
\n
"
,
deckbuf
[
it
]);
++
it
;
}
const
int
extrac
=
deckbuf
[
it
];
++
it
;
for
(
const
auto
&
code
:
deck
.
main
)
std
::
fprintf
(
fp
,
"%u
\n
"
,
code
);
std
::
fprintf
(
fp
,
"#extra
\n
"
);
for
(
int
i
=
0
;
i
<
extrac
;
++
i
)
{
std
::
fprintf
(
fp
,
"%d
\n
"
,
deckbuf
[
it
]);
++
it
;
}
const
int
sidec
=
deckbuf
[
it
];
++
it
;
for
(
const
auto
&
code
:
deck
.
extra
)
std
::
fprintf
(
fp
,
"%u
\n
"
,
code
);
std
::
fprintf
(
fp
,
"!side
\n
"
);
for
(
int
i
=
0
;
i
<
sidec
;
++
i
)
{
std
::
fprintf
(
fp
,
"%d
\n
"
,
deckbuf
[
it
]);
++
it
;
}
for
(
const
auto
&
code
:
deck
.
side
)
std
::
fprintf
(
fp
,
"%u
\n
"
,
code
);
std
::
fclose
(
fp
);
return
true
;
}
...
...
gframe/deck_manager.h
View file @
560c5b31
...
...
@@ -35,6 +35,12 @@ struct Deck {
}
};
struct
ReplayDeck
{
std
::
vector
<
uint32_t
>
main
;
std
::
vector
<
uint32_t
>
extra
;
std
::
vector
<
uint32_t
>
side
;
};
class
DeckManager
{
public:
Deck
current_deck
;
...
...
@@ -49,7 +55,6 @@ public:
unsigned
int
CheckDeck
(
const
Deck
&
deck
,
unsigned
int
lfhash
,
int
rule
);
bool
LoadCurrentDeck
(
const
wchar_t
*
file
,
bool
is_packlist
=
false
);
bool
LoadCurrentDeck
(
int
category_index
,
const
wchar_t
*
category_name
,
const
wchar_t
*
deckname
);
bool
SaveDeckBuffer
(
const
int
deckbuf
[],
const
wchar_t
*
name
);
static
uint32_t
LoadDeck
(
Deck
&
deck
,
uint32_t
dbuf
[],
int
mainc
,
int
sidec
,
bool
is_packlist
=
false
);
static
uint32_t
LoadDeckFromStream
(
Deck
&
deck
,
std
::
istringstream
&
deckStream
,
bool
is_packlist
=
false
);
...
...
@@ -63,6 +68,7 @@ public:
static
bool
CreateCategory
(
const
wchar_t
*
name
);
static
bool
RenameCategory
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
static
bool
DeleteCategory
(
const
wchar_t
*
name
);
static
bool
SaveDeckBuffer
(
const
ReplayDeck
&
deck
,
const
wchar_t
*
name
);
};
extern
DeckManager
deckManager
;
...
...
gframe/replay.h
View file @
560c5b31
...
...
@@ -2,6 +2,7 @@
#define REPLAY_H
#include "config.h"
#include "deck_manager.h"
namespace
ygo
{
...
...
@@ -33,11 +34,6 @@ struct DuelParameters {
uint32_t
duel_flag
{};
};
struct
ReplayDeck
{
std
::
vector
<
uint32_t
>
main
;
std
::
vector
<
uint32_t
>
extra
;
};
class
Replay
{
public:
Replay
();
...
...
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