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
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
YGOPRO-520DIY
ygopro
Commits
2961cbb1
Commit
2961cbb1
authored
Jan 12, 2025
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move struct CardDataC to data_manager.h
parent
8b622643
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
34 deletions
+41
-34
gframe/client_card.cpp
gframe/client_card.cpp
+0
-1
gframe/client_card.h
gframe/client_card.h
+1
-23
gframe/data_manager.cpp
gframe/data_manager.cpp
+2
-2
gframe/data_manager.h
gframe/data_manager.h
+35
-6
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+0
-1
gframe/deck_manager.h
gframe/deck_manager.h
+1
-1
gframe/single_duel.h
gframe/single_duel.h
+1
-0
gframe/tag_duel.h
gframe/tag_duel.h
+1
-0
No files found.
gframe/client_card.cpp
View file @
2961cbb1
#include "client_card.h"
#include "client_field.h"
#include "data_manager.h"
#include "game.h"
namespace
ygo
{
...
...
gframe/client_card.h
View file @
2961cbb1
...
...
@@ -2,35 +2,13 @@
#define CLIENT_CARD_H
#include "config.h"
#include "
../ocgcore/card_data
.h"
#include "
data_manager
.h"
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
namespace
ygo
{
using
CardData
=
card_data
;
struct
CardDataC
:
card_data
{
unsigned
int
ot
{};
unsigned
int
category
{};
bool
is_setcodes
(
std
::
vector
<
uint32_t
>
values
)
const
{
for
(
auto
&
value
:
values
)
{
if
(
is_setcode
(
value
))
return
true
;
}
return
false
;
}
};
struct
CardString
{
std
::
wstring
name
;
std
::
wstring
text
;
std
::
wstring
desc
[
16
];
};
typedef
std
::
unordered_map
<
unsigned
int
,
CardDataC
>::
const_iterator
code_pointer
;
typedef
std
::
unordered_map
<
unsigned
int
,
CardString
>::
const_iterator
string_pointer
;
class
ClientCard
{
public:
irr
::
core
::
matrix4
mTransform
;
...
...
gframe/data_manager.cpp
View file @
2961cbb1
...
...
@@ -7,7 +7,7 @@ namespace ygo {
const
wchar_t
*
DataManager
::
unknown_string
=
L"???"
;
unsigned
char
DataManager
::
scriptBuffer
[
0x100000
]
=
{};
IFileSystem
*
DataManager
::
FileSystem
=
nullptr
;
irr
::
io
::
IFileSystem
*
DataManager
::
FileSystem
=
nullptr
;
DataManager
dataManager
;
DataManager
::
DataManager
()
:
_datas
(
32768
),
_strings
(
32768
)
{
...
...
@@ -119,7 +119,7 @@ bool DataManager::LoadStrings(const char* file) {
fclose
(
fp
);
return
true
;
}
bool
DataManager
::
LoadStrings
(
IReadFile
*
reader
)
{
bool
DataManager
::
LoadStrings
(
irr
::
io
::
IReadFile
*
reader
)
{
char
ch
{};
std
::
string
linebuf
;
while
(
reader
->
read
(
&
ch
,
1
))
{
...
...
gframe/data_manager.h
View file @
2961cbb1
#ifndef DATAMANAGER_H
#define DATAMANAGER_H
#include "config.h"
#include <unordered_map>
#include <vector>
#include <string>
#include <sqlite3.h>
#include "client_card.h"
#include "../ocgcore/card_data.h"
namespace
irr
{
namespace
io
{
class
IReadFile
;
class
IFileSystem
;
}
}
namespace
ygo
{
constexpr
int
MAX_STRING_ID
=
0x7ff
;
constexpr
unsigned
int
MIN_CARD_ID
=
(
unsigned
int
)(
MAX_STRING_ID
+
1
)
>>
4
;
constexpr
int
MAX_STRING_ID
=
0x7ff
;
constexpr
unsigned
int
MIN_CARD_ID
=
(
unsigned
int
)(
MAX_STRING_ID
+
1
)
>>
4
;
using
CardData
=
card_data
;
struct
CardDataC
:
card_data
{
unsigned
int
ot
{};
unsigned
int
category
{};
bool
is_setcodes
(
std
::
vector
<
uint32_t
>
values
)
const
{
for
(
auto
&
value
:
values
)
{
if
(
is_setcode
(
value
))
return
true
;
}
return
false
;
}
};
struct
CardString
{
std
::
wstring
name
;
std
::
wstring
text
;
std
::
wstring
desc
[
16
];
};
typedef
std
::
unordered_map
<
unsigned
int
,
CardDataC
>::
const_iterator
code_pointer
;
typedef
std
::
unordered_map
<
unsigned
int
,
CardString
>::
const_iterator
string_pointer
;
class
DataManager
{
public:
...
...
@@ -16,7 +45,7 @@ public:
bool
ReadDB
(
sqlite3
*
pDB
);
bool
LoadDB
(
const
wchar_t
*
wfile
);
bool
LoadStrings
(
const
char
*
file
);
bool
LoadStrings
(
IReadFile
*
reader
);
bool
LoadStrings
(
irr
::
io
::
IReadFile
*
reader
);
void
ReadStringConfLine
(
const
char
*
linebuf
);
bool
Error
(
sqlite3
*
pDB
,
sqlite3_stmt
*
pStmt
=
nullptr
);
...
...
@@ -60,7 +89,7 @@ public:
//read by fread
static
unsigned
char
*
DefaultScriptReader
(
const
char
*
script_name
,
int
*
slen
);
static
IFileSystem
*
FileSystem
;
static
irr
::
io
::
IFileSystem
*
FileSystem
;
private:
std
::
unordered_map
<
unsigned
int
,
CardDataC
>
_datas
;
...
...
gframe/deck_manager.cpp
View file @
2961cbb1
#include "deck_manager.h"
#include "myfilesystem.h"
#include "data_manager.h"
#include "network.h"
#include "game.h"
...
...
gframe/deck_manager.h
View file @
2961cbb1
...
...
@@ -2,7 +2,7 @@
#define DECKMANAGER_H
#include "config.h"
#include "
client_card
.h"
#include "
data_manager
.h"
#include <unordered_map>
#include <vector>
#include <sstream>
...
...
gframe/single_duel.h
View file @
2961cbb1
#ifndef SINGLE_DUEL_H
#define SINGLE_DUEL_H
#include <set>
#include "network.h"
#include "deck_manager.h"
#include "replay.h"
...
...
gframe/tag_duel.h
View file @
2961cbb1
#ifndef TAG_DUEL_H
#define TAG_DUEL_H
#include <set>
#include "network.h"
#include "deck_manager.h"
#include "replay.h"
...
...
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