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
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
baichixing
Neos
Commits
31503a72
Commit
31503a72
authored
Dec 30, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename Card to Hand
parent
7495764e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
10 deletions
+7
-10
src/reducers/duel/handsSlice.ts
src/reducers/duel/handsSlice.ts
+3
-3
src/reducers/duel/util.ts
src/reducers/duel/util.ts
+1
-4
src/ui/Duel/hands.tsx
src/ui/Duel/hands.tsx
+3
-3
No files found.
src/reducers/duel/handsSlice.ts
View file @
31503a72
...
@@ -7,12 +7,12 @@ import {
...
@@ -7,12 +7,12 @@ import {
import
{
DuelState
}
from
"
./mod
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
RootState
}
from
"
../../store
"
;
import
{
RootState
}
from
"
../../store
"
;
import
{
fetchCard
,
CardMeta
}
from
"
../../api/cards
"
;
import
{
fetchCard
,
CardMeta
}
from
"
../../api/cards
"
;
import
{
judgeSelf
,
Car
d
,
Interactivity
}
from
"
./util
"
;
import
{
judgeSelf
,
Han
d
,
Interactivity
}
from
"
./util
"
;
import
*
as
UICONFIG
from
"
../../config/ui
"
;
import
*
as
UICONFIG
from
"
../../config/ui
"
;
export
interface
Hands
{
export
interface
Hands
{
// 注意:手牌的位置顺序是有约束的
// 注意:手牌的位置顺序是有约束的
cards
:
Car
d
[];
cards
:
Han
d
[];
}
}
// 增加手牌
// 增加手牌
...
@@ -86,7 +86,7 @@ export const handsCase = (builder: ActionReducerMapBuilder<DuelState>) => {
...
@@ -86,7 +86,7 @@ export const handsCase = (builder: ActionReducerMapBuilder<DuelState>) => {
// 更新手牌的位置和旋转信息
// 更新手牌的位置和旋转信息
//
//
// TODO: 兼容对方手牌
// TODO: 兼容对方手牌
function
setHandsTransform
(
hands
:
Car
d
[]):
void
{
function
setHandsTransform
(
hands
:
Han
d
[]):
void
{
const
groundShape
=
UICONFIG
.
GroundShape
();
const
groundShape
=
UICONFIG
.
GroundShape
();
const
handShape
=
UICONFIG
.
HandShape
();
const
handShape
=
UICONFIG
.
HandShape
();
const
gap
=
groundShape
.
width
/
(
hands
.
length
-
1
);
const
gap
=
groundShape
.
width
/
(
hands
.
length
-
1
);
...
...
src/reducers/duel/util.ts
View file @
31503a72
...
@@ -25,10 +25,7 @@ export function judgeSelf(player: number, state: Draft<DuelState>): boolean {
...
@@ -25,10 +25,7 @@ export function judgeSelf(player: number, state: Draft<DuelState>): boolean {
}
}
}
}
/*
export
interface
Hand
{
* `Neos`中表示卡牌的通用结构
* */
export
interface
Card
{
meta
:
CardMeta
;
meta
:
CardMeta
;
transform
:
CardTransform
;
transform
:
CardTransform
;
interactivities
:
Interactivity
<
number
>
[];
interactivities
:
Interactivity
<
number
>
[];
...
...
src/ui/Duel/hands.tsx
View file @
31503a72
...
@@ -2,7 +2,7 @@ import * as BABYLON from "@babylonjs/core";
...
@@ -2,7 +2,7 @@ import * as BABYLON from "@babylonjs/core";
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
selectMeHands
}
from
"
../../reducers/duel/handsSlice
"
;
import
{
selectMeHands
}
from
"
../../reducers/duel/handsSlice
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
import
{
Car
d
,
InteractType
}
from
"
../../reducers/duel/util
"
;
import
{
Han
d
,
InteractType
}
from
"
../../reducers/duel/util
"
;
import
{
import
{
setCardModalImgUrl
,
setCardModalImgUrl
,
setCardModalIsOpen
,
setCardModalIsOpen
,
...
@@ -20,13 +20,13 @@ const Hands = () => {
...
@@ -20,13 +20,13 @@ const Hands = () => {
return
(
return
(
<>
<>
{
hands
.
map
((
hand
,
idx
)
=>
{
{
hands
.
map
((
hand
,
idx
)
=>
{
return
<
Hand
state=
{
hand
}
idx=
{
idx
}
key=
{
idx
}
/>;
return
<
C
Hand
state=
{
hand
}
idx=
{
idx
}
key=
{
idx
}
/>;
})
}
})
}
</>
</>
);
);
};
};
const
Hand
=
(
props
:
{
state
:
Car
d
;
idx
:
number
})
=>
{
const
CHand
=
(
props
:
{
state
:
Han
d
;
idx
:
number
})
=>
{
const
handShape
=
CONFIG
.
HandShape
();
const
handShape
=
CONFIG
.
HandShape
();
const
hoverScale
=
CONFIG
.
HandHoverScaling
();
const
hoverScale
=
CONFIG
.
HandHoverScaling
();
const
defaultScale
=
new
BABYLON
.
Vector3
(
1
,
1
,
1
);
const
defaultScale
=
new
BABYLON
.
Vector3
(
1
,
1
,
1
);
...
...
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