@@ -32,7 +32,7 @@ public GameStateInternal Simulate(GameStateInternal state, int currentDepth, Mov
32
32
if ( ! Game . Params . MapLogicSize . ContainsPoint ( me . Position ) || // Выехал за пределы карты
33
33
me . Tail . Contains ( me . Position ) ) // Наехал сам себе на хвост
34
34
{
35
- return GetDeadState ( ) ;
35
+ return null ;
36
36
}
37
37
38
38
var enemies = ( PlayerInternal [ ] ) state . Enemies . Clone ( ) ;
@@ -44,7 +44,7 @@ public GameStateInternal Simulate(GameStateInternal state, int currentDepth, Mov
44
44
if ( enemies . Any ( enemy => ( enemy . DistanceMap [ state . Me . Position . X , state . Me . Position . Y ] <= currentDepth + 1 ||
45
45
enemy . DistanceMap [ me . Position . X , me . Position . Y ] <= currentDepth + 1 ) && enemy . Tail . Length <= me . Tail . Length ) ) // Лобовое столкновение с противником с меньшим хвостом
46
46
{
47
- return GetDeadState ( ) ;
47
+ return null ;
48
48
}
49
49
50
50
var capturedTerritory = _territoryCapturer . Capture ( me . Territory , me . Tail ) ;
@@ -72,11 +72,11 @@ public GameStateInternal Simulate(GameStateInternal state, int currentDepth, Mov
72
72
me . Tail = me . Tail . Append ( me . Position ) ;
73
73
if ( me . PathToHome == null ) // Зашел в тупик
74
74
{
75
- return GetDeadState ( ) ;
75
+ return null ;
76
76
}
77
77
if ( me . Tail . Any ( p => state . DangerousMap [ p . X , p . Y ] <= currentDepth + me . PathToHome . Length ) ) // Потенциально могут наехать на мой хвост
78
78
{
79
- return GetDeadState ( ) ;
79
+ return null ;
80
80
}
81
81
}
82
82
@@ -96,8 +96,6 @@ public GameStateInternal Simulate(GameStateInternal state, int currentDepth, Mov
96
96
enemies = hasLosers ? enemies . Where ( e => e != null ) . ToArray ( ) : enemies ;
97
97
98
98
return new GameStateInternal ( nextTickNumber , me , enemies , nextBonuses , state , hasLosers ? null : state . DangerousMap ) ;
99
-
100
- GameStateInternal GetDeadState ( ) => new GameStateInternal ( nextTickNumber , null , state . Enemies , state . Bonuses , state , state . DangerousMap ) ;
101
99
}
102
100
}
103
101
}
0 commit comments