Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
Neos
Commits
ff75a890
Commit
ff75a890
authored
Dec 02, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add newPhase
parent
43b00a01
Pipeline
#18312
passed with stages
in 2 minutes and 20 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
6 deletions
+17
-6
src/api/ocgcore/ocgAdapter/bufferIO.ts
src/api/ocgcore/ocgAdapter/bufferIO.ts
+1
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/newPhase.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/newPhase.ts
+2
-2
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+8
-2
src/service/duel/newPhase.ts
src/service/duel/newPhase.ts
+2
-1
src/ui/Duel/simpleDuel/mod.tsx
src/ui/Duel/simpleDuel/mod.tsx
+4
-0
No files found.
src/api/ocgcore/ocgAdapter/bufferIO.ts
View file @
ff75a890
...
...
@@ -29,7 +29,7 @@ export class BufferReader {
}
readUint16
():
number
{
const
ret
=
this
.
dataView
.
getUint16
(
this
.
offset
);
const
ret
=
this
.
dataView
.
getUint16
(
this
.
offset
,
this
.
littleEndian
);
this
.
offset
+=
OFFSET_UINT16
;
return
ret
;
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/newPhase.ts
View file @
ff75a890
...
...
@@ -14,10 +14,10 @@ const LITTLE_ENDIAN = true;
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReader
(
data
,
LITTLE_ENDIAN
);
const
p
layer
=
reader
.
readUint16
();
const
p
hase
=
reader
.
readUint16
();
let
phaseType
=
ygopro
.
StocGameMessage
.
MsgNewPhase
.
PhaseType
.
UNKNOWN
;
switch
(
p
layer
)
{
switch
(
p
hase
)
{
case
0x01
:
{
phaseType
=
ygopro
.
StocGameMessage
.
MsgNewPhase
.
PhaseType
.
DRAW
;
...
...
src/reducers/duel/mod.ts
View file @
ff75a890
...
...
@@ -42,8 +42,14 @@ const duelSlice = createSlice({
},
});
export
const
{
meInfoInit
,
opInfoInit
,
meAddHands
,
opAddHands
,
updateTurn
}
=
duelSlice
.
actions
;
export
const
{
meInfoInit
,
opInfoInit
,
meAddHands
,
opAddHands
,
updateTurn
,
updatePhase
,
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
null
;
};
...
...
src/service/duel/newPhase.ts
View file @
ff75a890
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
{
updatePhase
}
from
"
../../reducers/duel/mod
"
;
export
default
(
newPhase
:
ygopro
.
StocGameMessage
.
MsgNewPhase
,
dispatch
:
AppDispatch
)
=>
{
// TODO
dispatch
(
updatePhase
(
newPhase
.
phase_type
.
toString
()));
};
src/ui/Duel/simpleDuel/mod.tsx
View file @
ff75a890
...
...
@@ -19,6 +19,7 @@ import renderField from "./field";
import
*
as
CONFIG
from
"
../../../config/ui
"
;
import
{
Card
}
from
"
../../../api/cards
"
;
import
{
selectCurrentPlayer
}
from
"
../../../reducers/duel/turnSlice
"
;
import
{
selectCurrentPhase
}
from
"
../../../reducers/duel/phaseSlice
"
;
// CONFIG
...
...
@@ -36,6 +37,7 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
};
const
hands
=
useAppSelector
(
this
.
handsSelector
||
defaultHandsSelector
);
const
currentPlayer
=
useAppSelector
(
selectCurrentPlayer
);
const
currentPhase
=
useAppSelector
(
selectCurrentPhase
);
// ----- WebGL渲染 -----
const
canvasRef
=
useRef
<
HTMLCanvasElement
>
(
null
);
...
...
@@ -107,6 +109,8 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
// 当前操作玩家
console
.
log
(
`currentPlayer:`
+
currentPlayer
);
// 当前阶段
console
.
log
(
`currentPhase:`
+
currentPhase
);
// 渲染循环
engine
.
runRenderLoop
(()
=>
{
...
...
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