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
love_飞影
Neos
Commits
4b8c5cff
Commit
4b8c5cff
authored
Jan 01, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move interactTypeToString to util.ts
parent
8e4708ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
28 deletions
+30
-28
src/ui/Duel/hands.tsx
src/ui/Duel/hands.tsx
+2
-28
src/ui/Duel/util.ts
src/ui/Duel/util.ts
+28
-0
No files found.
src/ui/Duel/hands.tsx
View file @
4b8c5cff
...
...
@@ -2,7 +2,7 @@ import * as BABYLON from "@babylonjs/core";
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
selectMeHands
}
from
"
../../reducers/duel/handsSlice
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
import
{
Hand
,
InteractType
}
from
"
../../reducers/duel/util
"
;
import
{
Hand
}
from
"
../../reducers/duel/util
"
;
import
{
setCardModalImgUrl
,
setCardModalIsOpen
,
...
...
@@ -14,7 +14,7 @@ import { useHover } from "react-babylonjs";
import
{
useClick
}
from
"
./hook
"
;
import
{
useState
,
useRef
,
useEffect
}
from
"
react
"
;
import
{
useSpring
,
animated
}
from
"
./spring
"
;
import
{
zip
}
from
"
./util
"
;
import
{
zip
,
interactTypeToString
}
from
"
./util
"
;
const
groundShape
=
CONFIG
.
GroundShape
();
const
left
=
-
(
groundShape
.
width
/
2
);
...
...
@@ -142,32 +142,6 @@ const CHand = (props: {
);
};
function
interactTypeToString
(
t
:
InteractType
):
string
{
switch
(
t
)
{
case
InteractType
.
SUMMON
:
{
return
"
普通召唤
"
;
}
case
InteractType
.
SP_SUMMON
:
{
return
"
特殊召唤
"
;
}
case
InteractType
.
POS_CHANGE
:
{
return
"
改变表示形式
"
;
}
case
InteractType
.
MSET
:
{
return
"
前场放置
"
;
}
case
InteractType
.
SSET
:
{
return
"
后场放置
"
;
}
case
InteractType
.
ACTIVATE
:
{
return
"
发动效果
"
;
}
default
:
{
return
"
未知选项
"
;
}
}
}
const
handPositons
=
(
player
:
number
,
hands
:
Hand
[])
=>
{
const
gap
=
groundShape
.
width
/
(
hands
.
length
-
1
);
const
y
=
handShape
.
height
/
2
;
...
...
src/ui/Duel/util.ts
View file @
4b8c5cff
import
{
InteractType
}
from
"
../../reducers/duel/util
"
;
export
function
zip
<
S1
,
S2
>
(
firstCollection
:
Array
<
S1
>
,
lastCollection
:
Array
<
S2
>
...
...
@@ -11,3 +13,29 @@ export function zip<S1, S2>(
return
zipped
;
}
export
function
interactTypeToString
(
t
:
InteractType
):
string
{
switch
(
t
)
{
case
InteractType
.
SUMMON
:
{
return
"
普通召唤
"
;
}
case
InteractType
.
SP_SUMMON
:
{
return
"
特殊召唤
"
;
}
case
InteractType
.
POS_CHANGE
:
{
return
"
改变表示形式
"
;
}
case
InteractType
.
MSET
:
{
return
"
前场放置
"
;
}
case
InteractType
.
SSET
:
{
return
"
后场放置
"
;
}
case
InteractType
.
ACTIVATE
:
{
return
"
发动效果
"
;
}
default
:
{
return
"
未知选项
"
;
}
}
}
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