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
261c838e
Commit
261c838e
authored
Aug 06, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update roomStore
parent
b93e1471
Pipeline
#22925
failed with stages
in 13 minutes and 9 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
src/service/mora/selectHand.ts
src/service/mora/selectHand.ts
+2
-2
src/service/mora/selectTp.ts
src/service/mora/selectTp.ts
+2
-2
src/service/room/duelStart.ts
src/service/room/duelStart.ts
+2
-2
src/stores/roomStore.ts
src/stores/roomStore.ts
+11
-6
No files found.
src/service/mora/selectHand.ts
View file @
261c838e
import
{
ygopro
}
from
"
@/api
"
;
import
{
roomStore
}
from
"
@/stores
"
;
import
{
RoomStage
,
roomStore
}
from
"
@/stores
"
;
export
default
function
handleSelectHand
(
_
:
ygopro
.
YgoStocMsg
)
{
roomStore
.
s
electHand
=
true
;
roomStore
.
s
tage
=
RoomStage
.
SELECT_HAND
;
}
src/service/mora/selectTp.ts
View file @
261c838e
import
{
ygopro
}
from
"
@/api
"
;
import
{
roomStore
}
from
"
@/stores
"
;
import
{
RoomStage
,
roomStore
}
from
"
@/stores
"
;
export
default
function
handleSelectTp
(
_
:
ygopro
.
YgoStocMsg
)
{
roomStore
.
s
electTp
=
true
;
roomStore
.
s
tage
=
RoomStage
.
SELECT_TP
;
}
src/service/room/duelStart.ts
View file @
261c838e
import
{
ygopro
}
from
"
@/api
"
;
import
{
roomStore
}
from
"
@/stores
"
;
import
{
RoomStage
,
roomStore
}
from
"
@/stores
"
;
export
default
function
handleDuelStart
(
_pb
:
ygopro
.
YgoStocMsg
)
{
roomStore
.
moraStart
=
true
;
roomStore
.
stage
=
RoomStage
.
MORA
;
}
src/stores/roomStore.ts
View file @
261c838e
...
...
@@ -19,15 +19,22 @@ interface DeckInfo {
sideSize
:
number
;
}
// 房间内当前的阶段
export
enum
RoomStage
{
WAITING
=
0
,
// 正在准备
MORA
=
1
,
// 正在猜拳
SELECT_HAND
=
2
,
// 选择猜拳
SELECT_TP
=
2
,
// 选边
}
class
RoomStore
implements
NeosStore
{
joined
:
boolean
=
false
;
// 是否已经加入房间
players
:
Player
[]
=
[];
// 进入房间的玩家列表
observerCount
:
number
=
0
;
// 观战者数量
isHost
:
boolean
=
false
;
// 当前玩家是否是房主
selfType
:
SelfType
=
0
;
// 当前玩家的类型
moraStart
:
boolean
=
false
;
// 猜拳阶段是否开始
selectHand
:
boolean
=
false
;
// 是否可以选择猜拳
selectTp
:
boolean
=
false
;
// 是否可以选边
stage
:
RoomStage
=
RoomStage
.
WAITING
;
getMePlayer
()
{
if
(
this
.
selfType
==
SelfType
.
PLAYER1
)
return
this
.
players
[
0
];
...
...
@@ -43,9 +50,7 @@ class RoomStore implements NeosStore {
this
.
players
=
[];
this
.
observerCount
=
0
;
this
.
isHost
=
false
;
this
.
moraStart
=
false
;
this
.
selectHand
=
false
;
this
.
selectTp
=
false
;
this
.
stage
=
RoomStage
.
WAITING
;
}
}
...
...
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