5959 </div >
6060 </div >
6161
62+ <!-- AI 风格设置(仅人机对战) -->
63+ <div v-if =" gameMode === 'ai'" class =" setup-section" >
64+ <h3 >AI 风格</h3 >
65+ <div class =" option-group" >
66+ <label class =" option-card" :class =" { active: aiStyle === 'balanced' }" >
67+ <input v-model =" aiStyle" type =" radio" value =" balanced" />
68+ <span >均衡</span >
69+ </label >
70+ <label class =" option-card" :class =" { active: aiStyle === 'aggressive' }" >
71+ <input v-model =" aiStyle" type =" radio" value =" aggressive" />
72+ <span >进攻</span >
73+ </label >
74+ <label class =" option-card" :class =" { active: aiStyle === 'defensive' }" >
75+ <input v-model =" aiStyle" type =" radio" value =" defensive" />
76+ <span >防守</span >
77+ </label >
78+ <label class =" option-card" :class =" { active: aiStyle === 'unpredictable' }" >
79+ <input v-model =" aiStyle" type =" radio" value =" unpredictable" />
80+ <span >出其不意</span >
81+ </label >
82+ </div >
83+ </div >
84+
6285 <div class =" setup-section" >
6386 <h3 >执棋方</h3 >
6487 <div class =" option-group" >
94117<script setup lang="ts">
95118import { ref } from ' vue'
96119
120+ export type AIStyle = ' balanced' | ' aggressive' | ' defensive' | ' unpredictable'
121+
97122export interface GameSetupConfig {
98123 boardMode: ' standard' | ' custom'
99124 fen: string
@@ -102,6 +127,7 @@ export interface GameSetupConfig {
102127 starter: ' black' | ' random' | ' white'
103128 gameMode: ' ai' | ' human' | ' remote'
104129 difficulty: number
130+ aiStyle: AIStyle
105131}
106132
107133const emit = defineEmits <{
@@ -112,6 +138,7 @@ const emit = defineEmits<{
112138const screen = ref <' home' | ' setup' >(' home' )
113139const gameMode = ref <' ai' | ' human' | ' remote' >(' ai' )
114140const difficulty = ref (3 )
141+ const aiStyle = ref <AIStyle >(' balanced' )
115142
116143const boardMode = ref <' standard' | ' custom' >(' standard' )
117144const fenInput = ref (' ' )
@@ -154,6 +181,7 @@ const handleStart = () => {
154181 starter: starter .value ,
155182 gameMode: gameMode .value ,
156183 difficulty: difficulty .value ,
184+ aiStyle: aiStyle .value ,
157185 })
158186}
159187 </script >
0 commit comments