-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathocgapi_types.h
More file actions
96 lines (84 loc) · 2.25 KB
/
Copy pathocgapi_types.h
File metadata and controls
96 lines (84 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* Copyright (c) 2019-2025, Edoardo Lolletti (edo9300) <[email protected]>
*
* SPDX-License-Identifier: MIT
*/
#ifndef OCGAPI_TYPES_H
#define OCGAPI_TYPES_H
#include <stdint.h>
#define OCG_VERSION_MAJOR 11
#define OCG_VERSION_MINOR 0
typedef enum OCG_LogTypes {
OCG_LOG_TYPE_ERROR,
OCG_LOG_TYPE_FROM_SCRIPT,
OCG_LOG_TYPE_FOR_DEBUG,
OCG_LOG_TYPE_UNDEFINED
}OCG_LogTypes;
typedef enum OCG_DuelCreationStatus {
OCG_DUEL_CREATION_SUCCESS,
OCG_DUEL_CREATION_NO_OUTPUT,
OCG_DUEL_CREATION_NOT_CREATED,
OCG_DUEL_CREATION_NULL_DATA_READER,
OCG_DUEL_CREATION_NULL_SCRIPT_READER
}OCG_DuelCreationStatus;
typedef enum OCG_DuelStatus {
OCG_DUEL_STATUS_END,
OCG_DUEL_STATUS_AWAITING,
OCG_DUEL_STATUS_CONTINUE
}OCG_DuelStatus;
typedef void* OCG_Duel;
typedef struct OCG_CardData {
uint32_t code;
uint32_t alias;
uint16_t* setcodes;
uint32_t type;
uint32_t level;
uint32_t attribute;
uint64_t race;
int32_t attack;
int32_t defense;
uint32_t lscale;
uint32_t rscale;
uint32_t link_marker;
}OCG_CardData;
typedef struct OCG_Player {
uint32_t startingLP;
uint32_t startingDrawCount;
uint32_t drawCountPerTurn;
}OCG_Player;
typedef void (*OCG_DataReader)(void* payload, uint32_t code, OCG_CardData* data);
typedef void (*OCG_DataReaderDone)(void* payload, OCG_CardData* data);
typedef int (*OCG_ScriptReader)(void* payload, OCG_Duel duel, const char* name);
typedef void (*OCG_LogHandler)(void* payload, const char* string, int type);
typedef struct OCG_DuelOptions {
uint64_t seed[4];
uint64_t flags;
OCG_Player team1;
OCG_Player team2;
OCG_DataReader cardReader;
void* payload1; /* relayed to cardReader */
OCG_ScriptReader scriptReader;
void* payload2; /* relayed to scriptReader */
OCG_LogHandler logHandler;
void* payload3; /* relayed to errorHandler */
OCG_DataReaderDone cardReaderDone;
void* payload4; /* relayed to cardReaderDone */
uint8_t enableUnsafeLibraries;
}OCG_DuelOptions;
typedef struct OCG_NewCardInfo {
uint8_t team; /* either 0 or 1 */
uint8_t duelist; /* index of original owner */
uint32_t code;
uint8_t con;
uint32_t loc;
uint32_t seq;
uint32_t pos;
}OCG_NewCardInfo;
typedef struct OCG_QueryInfo {
uint32_t flags;
uint8_t con;
uint32_t loc;
uint32_t seq;
uint32_t overlay_seq;
}OCG_QueryInfo;
#endif /* OCGAPI_TYPES_H */