99 APIDecisionStrategy ,
1010 PlayerDecisionStrategy ,
1111} from "../strategies/SnakeDecisionStrategies" ;
12- import { simpleAIAlgorithm , greedyAIAlgorithm } from "../ai/SnakeAI" ;
1312import { GameState } from "../types/GameState" ;
1413import { ParameterizedAIDecisionStrategy } from "../strategies/ChasingDecisionStrategy" ;
1514import { advancedAIAlgorithm } from "../ai/AdvancedSnakeAI" ;
@@ -52,10 +51,35 @@ export class EntityFactory {
5251 // First color is reserved for the primary/player snake
5352 const snakeColors = [
5453 GameConfig . COLORS . PLAYER ,
55- '#e6194B' , '#3cb44b' , '#4363d8' , '#f58231' , '#911eb4' , '#46f0f0' ,
56- '#f032e6' , '#bcf60c' , '#fabebe' , '#008080' , '#e6beff' , '#9A6324' ,
57- '#fffac8' , '#800000' , '#aaffc3' , '#808000' , '#ffd8b1' , '#000075' ,
58- '#808080' , '#ffe119' , '#469990' , '#dcbeff' , '#a9a9a9'
54+ "#e6194B" ,
55+ "#3cb44b" ,
56+ "#4363d8" ,
57+ "#f58231" ,
58+ "#911eb4" ,
59+ "#46f0f0" ,
60+ "#f032e6" ,
61+ "#bcf60c" ,
62+ "#fabebe" ,
63+ "#008080" ,
64+ "#e6beff" ,
65+ "#9A6324" ,
66+ "#fffac8" ,
67+ "#800000" ,
68+ "#aaffc3" ,
69+ "#808000" ,
70+ "#ffd8b1" ,
71+ "#000075" ,
72+ "#808080" ,
73+ "#ffe119" ,
74+ "#469990" ,
75+ "#dcbeff" ,
76+ "#a9a9a9" ,
77+ "#66c2a5" ,
78+ "#ff7f00" ,
79+ "#6a3d9a" ,
80+ "#b15928" ,
81+ "#17becf" ,
82+ "#8da0cb" ,
5983 ] ;
6084
6185 if ( ! selectedUsers || selectedUsers . length === 0 ) {
@@ -68,14 +92,14 @@ export class EntityFactory {
6892 const angle = index * angleStep ;
6993 const colorIndex = index % snakeColors . length ;
7094 const snake = this . createApiControlledSnake (
71- radius ,
72- angle ,
73- snakeColors [ colorIndex ] ,
74- clock ,
75- coordinator ,
76- gameSessionId ,
77- user ,
78- ) ;
95+ radius ,
96+ angle ,
97+ snakeColors [ colorIndex ] ,
98+ clock ,
99+ coordinator ,
100+ gameSessionId ,
101+ user
102+ ) ;
79103 // 为本局分配从1开始的编号,存入元数据
80104 snake . setMetadata ( { matchNumber : index + 1 } ) ;
81105 snakes . push ( snake ) ;
@@ -94,7 +118,7 @@ export class EntityFactory {
94118 clock : GameClock ,
95119 coordinator : DecisionRequestCoordinator ,
96120 gameSessionId : string ,
97- userData ?: Player ,
121+ userData ?: Player
98122 ) : Snake {
99123 const { x, y } = this . calculatePosition ( radius , angle ) ;
100124 const direction = this . getInitialDirection ( x , y ) ;
0 commit comments