Skip to content

Commit

Permalink
Merge pull request #98 from our-mini-games/chinese-chess-ms
Browse files Browse the repository at this point in the history
Chinese chess ms
  • Loading branch information
libondev committed Jan 15, 2024
2 parents a9e0ded + 5d6dd8f commit 2b773f1
Show file tree
Hide file tree
Showing 4 changed files with 234 additions and 19 deletions.
12 changes: 7 additions & 5 deletions packages/Chinese-chess/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'

export {}

declare module 'vue' {
declare module '@vue/runtime-core' {
export interface GlobalComponents {
ABadge: typeof import('ant-design-vue/es')['Badge']
AButton: typeof import('ant-design-vue/es')['Button']
Expand All @@ -29,6 +29,8 @@ declare module 'vue' {
Modal: typeof import('./src/components/Message/Modal.vue')['default']
ModeSelector: typeof import('./src/components/ModeSelector.vue')['default']
ProfileOutlined: typeof import('@ant-design/icons-vue')['ProfileOutlined']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
SoundOutlined: typeof import('@ant-design/icons-vue')['SoundOutlined']
Spectator: typeof import('./src/components/ChessMain/Spectator.vue')['default']
StatusWrapper: typeof import('./src/components/ChessMain/StatusWrapper.vue')['default']
Expand Down
188 changes: 188 additions & 0 deletions packages/Chinese-chess/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/Chinese-chess/src/libs/ChessManual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const changeXCoordMove = (currentCamp: Camp, piece: ChessPiece, x: number
// 士 象 马三种
// 只有马特殊判断 因为如果在一路上有前马和后马的话就要判断是那个马进行了移动
let text: string = piece.name
if (piece.name === '馬') {
const hasTowHorse: ChessPiece[] = chessPieces.filter(item => item.coord.x === piece.coord.x && item.coord.y !== piece.coord.y && item.camp === currentCamp && item.name === '馬')
if (piece.id === 3 || piece.id === 33) {
const hasTowHorse: ChessPiece[] = chessPieces.filter(item => item.coord.x === piece.coord.x && item.coord.y !== piece.coord.y && item.camp === currentCamp && piece.id === 3 || piece.id === 33)
if (hasTowHorse.length === 1) {
// 判断是前马还是后马
if (currentCamp === Camp.RED) {
Expand Down
Loading

0 comments on commit 2b773f1

Please sign in to comment.