Rename several MP traits
This commit is contained in:
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
if (!string.IsNullOrWhiteSpace(player.Faction) && !factions.Contains(player.Faction))
|
||||
emitError("Invalid faction {0} chosen for player {1}.".F(player.Faction, player.Name));
|
||||
|
||||
if (worldActor.HasTraitInfo<MPStartLocationsInfo>())
|
||||
if (worldActor.HasTraitInfo<MapStartingLocationsInfo>())
|
||||
{
|
||||
var playerCount = players.Count(p => p.Value.Playable);
|
||||
var spawns = new List<CPos>();
|
||||
|
||||
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Attach this to the world actor.")]
|
||||
public class CreateMPPlayersInfo : TraitInfo<CreateMPPlayers>, ICreatePlayersInfo
|
||||
public class CreateMapPlayersInfo : TraitInfo<CreateMapPlayers>, ICreatePlayersInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a list of GameInformation.Players that matches the indexing of ICreatePlayers.CreatePlayers.
|
||||
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class CreateMPPlayers : ICreatePlayers
|
||||
public class CreateMapPlayers : ICreatePlayers
|
||||
{
|
||||
void ICreatePlayers.CreatePlayers(World w, MersenneTwister playerRandom)
|
||||
{
|
||||
@@ -20,7 +20,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Allows the map to have working spawnpoints. Also controls the 'Separate Team Spawns' checkbox in the lobby options.")]
|
||||
public class MPStartLocationsInfo : TraitInfo, ILobbyOptions, IAssignSpawnPointsInfo
|
||||
public class MapStartingLocationsInfo : TraitInfo, ILobbyOptions, IAssignSpawnPointsInfo
|
||||
{
|
||||
public readonly WDist InitialExploreRange = WDist.FromCells(5);
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Display order for the spawn positions checkbox in the lobby.")]
|
||||
public readonly int SeparateTeamSpawnsCheckboxDisplayOrder = 0;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new MPStartLocations(this); }
|
||||
public override object Create(ActorInitializer init) { return new MapStartingLocations(this); }
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(Ruleset rules)
|
||||
{
|
||||
@@ -103,15 +103,15 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class MPStartLocations : IWorldLoaded, INotifyCreated, IAssignSpawnPoints
|
||||
public class MapStartingLocations : IWorldLoaded, INotifyCreated, IAssignSpawnPoints
|
||||
{
|
||||
readonly MPStartLocationsInfo info;
|
||||
readonly MapStartingLocationsInfo info;
|
||||
readonly Dictionary<int, Session.Client> occupiedSpawnPoints = new Dictionary<int, Session.Client>();
|
||||
bool separateTeamSpawns;
|
||||
CPos[] spawnLocations;
|
||||
List<int> availableSpawnPoints;
|
||||
|
||||
public MPStartLocations(MPStartLocationsInfo info)
|
||||
public MapStartingLocations(MapStartingLocationsInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
@@ -14,8 +14,8 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Used by SpawnMPUnits. Attach these to the world actor. You can have multiple variants by adding @suffixes.")]
|
||||
public class MPStartUnitsInfo : TraitInfo<MPStartUnits>
|
||||
[Desc("Used by SpawnStartingUnits. Attach these to the world actor. You can have multiple variants by adding @suffixes.")]
|
||||
public class StartingUnitsInfo : TraitInfo<StartingUnits>
|
||||
{
|
||||
[Desc("Internal class ID.")]
|
||||
public readonly string Class = "none";
|
||||
@@ -50,5 +50,5 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly WAngle? SupportActorsFacing = null;
|
||||
}
|
||||
|
||||
public class MPStartUnits { }
|
||||
public class StartingUnits { }
|
||||
}
|
||||
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Spawn base actor at the spawnpoint and support units in an annulus around the base actor. Both are defined at MPStartUnits. Attach this to the world actor.")]
|
||||
public class SpawnMPUnitsInfo : TraitInfo, Requires<MPStartUnitsInfo>, ILobbyOptions
|
||||
public class SpawnStartingUnitsInfo : TraitInfo, Requires<StartingUnitsInfo>, ILobbyOptions
|
||||
{
|
||||
public readonly string StartingUnitsClass = "none";
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var startingUnits = new Dictionary<string, string>();
|
||||
|
||||
// Duplicate classes are defined for different race variants
|
||||
foreach (var t in rules.Actors["world"].TraitInfos<MPStartUnitsInfo>())
|
||||
foreach (var t in rules.Actors["world"].TraitInfos<StartingUnitsInfo>())
|
||||
startingUnits[t.Class] = t.ClassName;
|
||||
|
||||
if (startingUnits.Any())
|
||||
@@ -51,14 +51,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
new ReadOnlyDictionary<string, string>(startingUnits), StartingUnitsClass, DropdownLocked);
|
||||
}
|
||||
|
||||
public override object Create(ActorInitializer init) { return new SpawnMPUnits(this); }
|
||||
public override object Create(ActorInitializer init) { return new SpawnStartingUnits(this); }
|
||||
}
|
||||
|
||||
public class SpawnMPUnits : IWorldLoaded
|
||||
public class SpawnStartingUnits : IWorldLoaded
|
||||
{
|
||||
readonly SpawnMPUnitsInfo info;
|
||||
readonly SpawnStartingUnitsInfo info;
|
||||
|
||||
public SpawnMPUnits(SpawnMPUnitsInfo info)
|
||||
public SpawnStartingUnits(SpawnStartingUnitsInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var spawnClass = p.PlayerReference.StartingUnitsClass ?? w.LobbyInfo.GlobalSettings
|
||||
.OptionOrDefault("startingunits", info.StartingUnitsClass);
|
||||
|
||||
var unitGroup = w.Map.Rules.Actors["world"].TraitInfos<MPStartUnitsInfo>()
|
||||
var unitGroup = w.Map.Rules.Actors["world"].TraitInfos<StartingUnitsInfo>()
|
||||
.Where(g => g.Class == spawnClass && g.Factions != null && g.Factions.Contains(p.Faction.InternalName))
|
||||
.RandomOrDefault(w.SharedRandom);
|
||||
|
||||
Reference in New Issue
Block a user