Changed code to use object initializers everywhere

This commit is contained in:
penev92
2022-01-20 01:07:24 +02:00
committed by abcdefg30
parent 70e2769a85
commit ab09ce21b4
9 changed files with 58 additions and 31 deletions

View File

@@ -66,11 +66,13 @@ namespace OpenRA.Mods.Common.Traits
object IAssignSpawnPointsInfo.InitializeState(MapPreview map, Session lobbyInfo)
{
var state = new AssignSpawnLocationsState();
var state = new AssignSpawnLocationsState
{
// Initialize the list of unoccupied spawn points for AssignSpawnLocations to pick from
SpawnLocations = map.SpawnPoints,
AvailableSpawnPoints = LobbyUtils.AvailableSpawnPoints(map.SpawnPoints.Length, lobbyInfo)
};
// Initialize the list of unoccupied spawn points for AssignSpawnLocations to pick from
state.SpawnLocations = map.SpawnPoints;
state.AvailableSpawnPoints = LobbyUtils.AvailableSpawnPoints(map.SpawnPoints.Length, lobbyInfo);
foreach (var kv in lobbyInfo.Slots)
{
var client = lobbyInfo.ClientInSlot(kv.Key);