File tree 2 files changed +15
-14
lines changed
2 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -179,9 +179,9 @@ private bool playerDeceased(int playerID) //这里需要判断大本营deceas
179
179
game . GameMap . GameObjLockDict [ GameObjType . Ship ] . EnterReadLock ( ) ;
180
180
try
181
181
{
182
- foreach ( Ship ship in game . GameMap . GameObjDict [ GameObjType . Ship ] )
182
+ foreach ( Ship ship in game . GameMap . GameObjDict [ GameObjType . Ship ] . Cast < Ship > ( ) )
183
183
{
184
- if ( ship . PlayerID == playerID && ship . PlayerState == PlayerStateType . Deceased ) return true ;
184
+ if ( ship . ShipID == playerID && ship . ShipState == ShipStateType . Deceased ) return true ;
185
185
}
186
186
}
187
187
finally
@@ -192,22 +192,22 @@ private bool playerDeceased(int playerID) //这里需要判断大本营deceas
192
192
return false ;
193
193
}
194
194
195
- public override int [ ] GetScore ( )
195
+ public override int [ ] GetMoney ( )
196
196
{
197
- int [ ] score = new int [ 2 ] ; // 0代表RedTeam,1代表BlueTeam
198
- game . GameMap . GameObjLockDict [ GameObjType . Home ] . EnterReadLock ( ) ;
199
- try
197
+ int [ ] money = new int [ 2 ] ; // 0代表RedTeam,1代表BlueTeam
198
+ foreach ( Team team in game . TeamList )
200
199
{
201
- foreach ( Home home in game . GameMap . GameObjDict [ GameObjType . Home ] )
202
- {
203
- if ( home . TeamID == 0 ) score [ 0 ] += ( int ) home . Score ;
204
- else score [ 1 ] += ( int ) home . Score ;
205
- }
206
-
200
+ money [ ( int ) team . TeamID ] = ( int ) game . GetTeamMoney ( team . TeamID ) ;
207
201
}
208
- finally
202
+ return money ;
203
+ }
204
+
205
+ public override int [ ] GetScore ( )
206
+ {
207
+ int [ ] score = new int [ 2 ] ; // 0代表RedTeam,1代表BlueTeam
208
+ foreach ( Team team in game . TeamList )
209
209
{
210
- game . GameMap . GameObjLockDict [ GameObjType . Home ] . ExitReadLock ( ) ;
210
+ score [ ( int ) team . TeamID ] = ( int ) game . GetTeamScore ( team . TeamID ) ;
211
211
}
212
212
return score ;
213
213
}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ namespace Server
5
5
abstract class ServerBase : AvailableService . AvailableServiceBase
6
6
{
7
7
public abstract void WaitForEnd ( ) ;
8
+ public abstract int [ ] GetMoney ( ) ;
8
9
public abstract int [ ] GetScore ( ) ;
9
10
}
10
11
}
You can’t perform that action at this time.
0 commit comments