Misc changes

* Use Pair instead of KeyValuePair
* double -> var
* Butcher XML comments
* Change WinState default to Undefined and use it instead of the new GameOutcome
* Other changes
This commit is contained in:
Pavlos Touboulidis
2014-05-20 17:45:33 +03:00
parent fe1eb1f3e0
commit b8bbd55598
8 changed files with 74 additions and 134 deletions

View File

@@ -16,62 +16,30 @@ using OpenRA.Network;
namespace OpenRA namespace OpenRA
{ {
/// <summary>
/// Contains information about a finished game
/// </summary>
public class GameInformation public class GameInformation
{ {
/// <summary>The map identifier.</summary>
public string MapUid; public string MapUid;
/// <summary>The map title.</summary>
public string MapTitle; public string MapTitle;
/// <summary>Game start timestamp.</summary>
public DateTime StartTimeUtc; public DateTime StartTimeUtc;
/// <summary>Game end timestamp (when the recoding stopped).</summary> // Game end timestamp (when the recoding stopped).
public DateTime EndTimeUtc; public DateTime EndTimeUtc;
/// <summary> // Gets the game's duration, from the time the game started until the
/// Gets the game's duration, from the time the game started until the // replay recording stopped.
/// replay recording stopped.
/// </summary>
/// <value>The game's duration.</value>
public TimeSpan Duration { get { return EndTimeUtc > StartTimeUtc ? EndTimeUtc - StartTimeUtc : TimeSpan.Zero; } } public TimeSpan Duration { get { return EndTimeUtc > StartTimeUtc ? EndTimeUtc - StartTimeUtc : TimeSpan.Zero; } }
/// <summary>
/// Gets the list of players.
/// </summary>
/// <value>The players.</value>
public IList<Player> Players { get; private set; } public IList<Player> Players { get; private set; }
/// <summary>
/// Gets the map preview, using <see cref="Game.modData.MapCache"/> and the <see cref="MapUid"/>.
/// </summary>
/// <value>The map preview.</value>
public MapPreview MapPreview { get { return Game.modData.MapCache[MapUid]; } } public MapPreview MapPreview { get { return Game.modData.MapCache[MapUid]; } }
/// <summary>
/// Gets the human players.
/// </summary>
/// <value>The human players.</value>
public IEnumerable<Player> HumanPlayers { get { return Players.Where(p => p.IsHuman); } } public IEnumerable<Player> HumanPlayers { get { return Players.Where(p => p.IsHuman); } }
/// <summary>
/// Gets a value indicating whether this instance has just one human player.
/// </summary>
/// <value><c>true</c> if this instance has just one human player; otherwise, <c>false</c>.</value>
public bool IsSinglePlayer { get { return HumanPlayers.Count() == 1; } } public bool IsSinglePlayer { get { return HumanPlayers.Count() == 1; } }
Dictionary<OpenRA.Player, Player> playersByRuntime; Dictionary<OpenRA.Player, Player> playersByRuntime;
/// <summary>
/// Initializes a new instance of the class.
/// </summary>
public GameInformation() public GameInformation()
{ {
Players = new List<Player>(); Players = new List<Player>();
playersByRuntime = new Dictionary<OpenRA.Player, Player>(); playersByRuntime = new Dictionary<OpenRA.Player, Player>();
} }
/// <summary>
/// Deserialize the specified data into a new instance.
/// </summary>
/// <param name="data">Data.</param>
public static GameInformation Deserialize(string data) public static GameInformation Deserialize(string data)
{ {
try try
@@ -104,9 +72,6 @@ namespace OpenRA
} }
} }
/// <summary>
/// Serialize this instance.
/// </summary>
public string Serialize() public string Serialize()
{ {
var nodes = new List<MiniYamlNode>(); var nodes = new List<MiniYamlNode>();
@@ -119,11 +84,7 @@ namespace OpenRA
return nodes.WriteToString(); return nodes.WriteToString();
} }
/// <summary> // Adds the player information at start-up.
/// Adds the start-up player information.
/// </summary>
/// <param name="runtimePlayer">Runtime player.</param>
/// <param name="lobbyInfo">Lobby info.</param>
public void AddPlayer(OpenRA.Player runtimePlayer, Session lobbyInfo) public void AddPlayer(OpenRA.Player runtimePlayer, Session lobbyInfo)
{ {
if (runtimePlayer == null) if (runtimePlayer == null)
@@ -160,11 +121,7 @@ namespace OpenRA
Players.Add(player); Players.Add(player);
} }
/// <summary> // Gets the player information for the specified runtime player instance.
/// Gets the player information for the specified runtime player instance.
/// </summary>
/// <returns>The player, or <c>null</c>.</returns>
/// <param name="runtimePlayer">Runtime player.</param>
public Player GetPlayer(OpenRA.Player runtimePlayer) public Player GetPlayer(OpenRA.Player runtimePlayer)
{ {
Player player; Player player;
@@ -174,56 +131,37 @@ namespace OpenRA
return player; return player;
} }
/// <summary>Specifies whether the player was defeated, victorious, or there was no outcome defined.</summary>
public enum GameOutcome
{
/// <summary>Unknown outcome.</summary>
Undefined,
/// <summary>The player was defeated</summary>
Defeat,
/// <summary>The player was victorious</summary>
Victory
}
///<summary>
/// Information about a player
/// </summary>
public class Player public class Player
{ {
// //
// Start-up information // Start-up information
// //
/// <summary>The client index.</summary>
public int ClientIndex; public int ClientIndex;
/// <summary>The player name, not guaranteed to be unique.</summary> // The player name, not guaranteed to be unique.
public string Name; public string Name;
/// <summary><c>true</c> if the player is a human player; otherwise, <c>false</c>.</summary>
public bool IsHuman; public bool IsHuman;
/// <summary><c>true</c> if the player is a bot; otherwise, <c>false</c>.</summary>
public bool IsBot; public bool IsBot;
/// <summary>The faction name (aka Country).</summary> // The faction name (aka Country)
public string FactionName; public string FactionName;
/// <summary>The faction id (aka Country, aka Race).</summary> // The faction id (aka Country, aka Race)
public string FactionId; public string FactionId;
/// <summary>The color used by the player in the game.</summary>
public HSLColor Color; public HSLColor Color;
/// <summary>The team id on start-up, or 0 if the player is not part of the team.</summary> // The team id on start-up, or 0 if the player is not part of the team.
public int Team; public int Team;
/// <summary>The index of the spawn point on the map, or 0 if the player is not part of the team.</summary>
public int SpawnPoint; public int SpawnPoint;
/// <summary><c>true</c> if the faction was chosen at random; otherwise, <c>false</c>.</summary> // True if the faction was chosen at random; otherwise, false
public bool IsRandomFaction; public bool IsRandomFaction;
/// <summary><c>true</c> if the spawn point was chosen at random; otherwise, <c>false</c>.</summary> // True if the spawn point was chosen at random; otherwise, false.</summary>
public bool IsRandomSpawnPoint; public bool IsRandomSpawnPoint;
// //
// Information gathered at a later stage // Information gathered at a later stage
// //
/// <summary>The game outcome for this player.</summary> // The game outcome for this player
public GameOutcome Outcome; public WinState Outcome;
/// <summary>The time when this player won or lost the game.</summary> // The time when this player won or lost the game
public DateTime OutcomeTimestampUtc; public DateTime OutcomeTimestampUtc;
} }
} }

View File

@@ -23,7 +23,7 @@ using OpenRA.Traits;
namespace OpenRA namespace OpenRA
{ {
public enum PowerState { Normal, Low, Critical }; public enum PowerState { Normal, Low, Critical };
public enum WinState { Won, Lost, Undefined }; public enum WinState { Undefined, Won, Lost };
public class Player : IScriptBindable, IScriptNotifyBind, ILuaTableBinding, ILuaEqualityBinding, ILuaToStringBinding public class Player : IScriptBindable, IScriptNotifyBind, ILuaTableBinding, ILuaEqualityBinding, ILuaToStringBinding
{ {

View File

@@ -58,7 +58,7 @@ namespace OpenRA.Widgets
{ {
SpriteFont font; SpriteFont font;
if (!Game.Renderer.Fonts.TryGetValue(Font, out font)) if (!Game.Renderer.Fonts.TryGetValue(Font, out font))
throw new ArgumentException("Request font '{0}' was not found.".F(Font)); throw new ArgumentException("Requested font '{0}' was not found.".F(Font));
var text = GetText(); var text = GetText();
if (text == null) if (text == null)

View File

@@ -308,9 +308,7 @@ namespace OpenRA
var pi = gameInfo.GetPlayer(player); var pi = gameInfo.GetPlayer(player);
if (pi != null) if (pi != null)
{ {
pi.Outcome = player.WinState == WinState.Lost ? GameInformation.GameOutcome.Defeat pi.Outcome = player.WinState;
: player.WinState == WinState.Won ? GameInformation.GameOutcome.Victory
: GameInformation.GameOutcome.Undefined;
pi.OutcomeTimestampUtc = DateTime.UtcNow; pi.OutcomeTimestampUtc = DateTime.UtcNow;
} }
} }

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Mods.RA
var client = world.LobbyInfo.ClientInSlot(kv.Key); var client = world.LobbyInfo.ClientInSlot(kv.Key);
var spid = (client == null || client.SpawnPoint == 0) var spid = (client == null || client.SpawnPoint == 0)
? ChooseSpawnPoint(world, available, taken) ? ChooseSpawnPoint(world, available, taken)
: spawns[client.SpawnPoint-1]; : spawns[client.SpawnPoint-1];
Start.Add(player, spid); Start.Add(player, spid);

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var preview = available.Get<MapPreviewWidget>("MAP_PREVIEW"); var preview = available.Get<MapPreviewWidget>("MAP_PREVIEW");
preview.Preview = () => lobby.Map; preview.Preview = () => lobby.Map;
preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi); preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi);
preview.SpawnOccupants = () => LobbyUtils.GetSpawnClients(orderManager.LobbyInfo, lobby.Map); preview.SpawnOccupants = () => LobbyUtils.GetSpawnOccupants(orderManager.LobbyInfo, lobby.Map);
var title = available.GetOrNull<LabelWidget>("MAP_TITLE"); var title = available.GetOrNull<LabelWidget>("MAP_TITLE");
if (title != null) if (title != null)
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var preview = invalid.Get<MapPreviewWidget>("MAP_PREVIEW"); var preview = invalid.Get<MapPreviewWidget>("MAP_PREVIEW");
preview.Preview = () => lobby.Map; preview.Preview = () => lobby.Map;
preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi); preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi);
preview.SpawnClients = () => LobbyUtils.GetSpawnClients(orderManager.LobbyInfo, lobby.Map); preview.SpawnOccupants = () => LobbyUtils.GetSpawnOccupants(orderManager.LobbyInfo, lobby.Map);
var title = invalid.GetOrNull<LabelWidget>("MAP_TITLE"); var title = invalid.GetOrNull<LabelWidget>("MAP_TITLE");
if (title != null) if (title != null)
@@ -73,7 +73,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var preview = download.Get<MapPreviewWidget>("MAP_PREVIEW"); var preview = download.Get<MapPreviewWidget>("MAP_PREVIEW");
preview.Preview = () => lobby.Map; preview.Preview = () => lobby.Map;
preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi); preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi);
preview.SpawnOccupants = () => LobbyUtils.GetSpawnClients(orderManager.LobbyInfo, lobby.Map); preview.SpawnOccupants = () => LobbyUtils.GetSpawnOccupants(orderManager.LobbyInfo, lobby.Map);
var title = download.GetOrNull<LabelWidget>("MAP_TITLE"); var title = download.GetOrNull<LabelWidget>("MAP_TITLE");
if (title != null) if (title != null)
@@ -100,7 +100,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var preview = progress.Get<MapPreviewWidget>("MAP_PREVIEW"); var preview = progress.Get<MapPreviewWidget>("MAP_PREVIEW");
preview.Preview = () => lobby.Map; preview.Preview = () => lobby.Map;
preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi); preview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint(orderManager, preview, lobby.Map, mi);
preview.SpawnOccupants = () => LobbyUtils.GetSpawnClients(orderManager.LobbyInfo, lobby.Map); preview.SpawnOccupants = () => LobbyUtils.GetSpawnOccupants(orderManager.LobbyInfo, lobby.Map);
var title = progress.GetOrNull<LabelWidget>("MAP_TITLE"); var title = progress.GetOrNull<LabelWidget>("MAP_TITLE");
if (title != null) if (title != null)

View File

@@ -149,14 +149,14 @@ namespace OpenRA.Mods.RA.Widgets.Logic
color.AttachPanel(colorChooser, onExit); color.AttachPanel(colorChooser, onExit);
} }
public static Dictionary<CPos, SpawnOccupant> GetSpawnClients(Session lobbyInfo, MapPreview preview) public static Dictionary<CPos, SpawnOccupant> GetSpawnOccupants(Session lobbyInfo, MapPreview preview)
{ {
var spawns = preview.SpawnPoints; var spawns = preview.SpawnPoints;
return lobbyInfo.Clients return lobbyInfo.Clients
.Where(c => c.SpawnPoint != 0) .Where(c => c.SpawnPoint != 0)
.ToDictionary(c => spawns[c.SpawnPoint - 1], c => new SpawnOccupant(c)); .ToDictionary(c => spawns[c.SpawnPoint - 1], c => new SpawnOccupant(c));
} }
public static Dictionary<CPos, SpawnOccupant> GetSpawnClients(IEnumerable<GameInformation.Player> players, MapPreview preview) public static Dictionary<CPos, SpawnOccupant> GetSpawnOccupants(IEnumerable<GameInformation.Player> players, MapPreview preview)
{ {
var spawns = preview.SpawnPoints; var spawns = preview.SpawnPoints;
return players return players

View File

@@ -104,25 +104,25 @@ namespace OpenRA.Mods.RA.Widgets.Logic
if (ddb != null) if (ddb != null)
{ {
// Using list to maintain the order // Using list to maintain the order
var options = new List<KeyValuePair<GameType, string>> var options = new List<Pair<GameType, string>>
{ {
new KeyValuePair<GameType, string>(GameType.Any, ddb.GetText()), Pair.New(GameType.Any, ddb.GetText()),
new KeyValuePair<GameType, string>(GameType.Singleplayer, "Singleplayer"), Pair.New(GameType.Singleplayer, "Singleplayer"),
new KeyValuePair<GameType, string>(GameType.Multiplayer, "Multiplayer") Pair.New(GameType.Multiplayer, "Multiplayer")
}; };
var lookup = options.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); var lookup = options.ToDictionary(kvp => kvp.First, kvp => kvp.Second);
ddb.GetText = () => lookup[filter.Type]; ddb.GetText = () => lookup[filter.Type];
ddb.OnMouseDown = _ => ddb.OnMouseDown = _ =>
{ {
Func<KeyValuePair<GameType, string>, ScrollItemWidget, ScrollItemWidget> setupItem = (option, tpl) => Func<Pair<GameType, string>, ScrollItemWidget, ScrollItemWidget> setupItem = (option, tpl) =>
{ {
var item = ScrollItemWidget.Setup( var item = ScrollItemWidget.Setup(
tpl, tpl,
() => filter.Type == option.Key, () => filter.Type == option.First,
() => { filter.Type = option.Key; ApplyFilter(); } () => { filter.Type = option.First; ApplyFilter(); }
); );
item.Get<LabelWidget>("LABEL").GetText = () => option.Value; item.Get<LabelWidget>("LABEL").GetText = () => option.Second;
return item; return item;
}; };
@@ -139,27 +139,27 @@ namespace OpenRA.Mods.RA.Widgets.Logic
if (ddb != null) if (ddb != null)
{ {
// Using list to maintain the order // Using list to maintain the order
var options = new List<KeyValuePair<DateType, string>> var options = new List<Pair<DateType, string>>
{ {
new KeyValuePair<DateType, string>(DateType.Any, ddb.GetText()), Pair.New(DateType.Any, ddb.GetText()),
new KeyValuePair<DateType, string>(DateType.Today, "Today"), Pair.New(DateType.Today, "Today"),
new KeyValuePair<DateType, string>(DateType.LastWeek, "Last 7 days"), Pair.New(DateType.LastWeek, "Last 7 days"),
new KeyValuePair<DateType, string>(DateType.LastFortnight, "Last 14 days"), Pair.New(DateType.LastFortnight, "Last 14 days"),
new KeyValuePair<DateType, string>(DateType.LastMonth, "Last 30 days") Pair.New(DateType.LastMonth, "Last 30 days")
}; };
var lookup = options.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); var lookup = options.ToDictionary(kvp => kvp.First, kvp => kvp.Second);
ddb.GetText = () => lookup[filter.Date]; ddb.GetText = () => lookup[filter.Date];
ddb.OnMouseDown = _ => ddb.OnMouseDown = _ =>
{ {
Func<KeyValuePair<DateType, string>, ScrollItemWidget, ScrollItemWidget> setupItem = (option, tpl) => Func<Pair<DateType, string>, ScrollItemWidget, ScrollItemWidget> setupItem = (option, tpl) =>
{ {
var item = ScrollItemWidget.Setup( var item = ScrollItemWidget.Setup(
tpl, tpl,
() => filter.Date == option.Key, () => filter.Date == option.First,
() => { filter.Date = option.Key; ApplyFilter(); } () => { filter.Date = option.First; ApplyFilter(); }
); );
item.Get<LabelWidget>("LABEL").GetText = () => option.Value; item.Get<LabelWidget>("LABEL").GetText = () => option.Second;
return item; return item;
}; };
@@ -176,27 +176,27 @@ namespace OpenRA.Mods.RA.Widgets.Logic
if (ddb != null) if (ddb != null)
{ {
// Using list to maintain the order // Using list to maintain the order
var options = new List<KeyValuePair<DurationType, string>> var options = new List<Pair<DurationType, string>>
{ {
new KeyValuePair<DurationType, string>(DurationType.Any, ddb.GetText()), Pair.New(DurationType.Any, ddb.GetText()),
new KeyValuePair<DurationType, string>(DurationType.VeryShort, "Under 5 min"), Pair.New(DurationType.VeryShort, "Under 5 min"),
new KeyValuePair<DurationType, string>(DurationType.Short, "Short (10 min)"), Pair.New(DurationType.Short, "Short (10 min)"),
new KeyValuePair<DurationType, string>(DurationType.Medium, "Medium (30 min)"), Pair.New(DurationType.Medium, "Medium (30 min)"),
new KeyValuePair<DurationType, string>(DurationType.Long, "Long (60+ min)") Pair.New(DurationType.Long, "Long (60+ min)")
}; };
var lookup = options.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); var lookup = options.ToDictionary(kvp => kvp.First, kvp => kvp.Second);
ddb.GetText = () => lookup[filter.Duration]; ddb.GetText = () => lookup[filter.Duration];
ddb.OnMouseDown = _ => ddb.OnMouseDown = _ =>
{ {
Func<KeyValuePair<DurationType, string>, ScrollItemWidget, ScrollItemWidget> setupItem = (option, tpl) => Func<Pair<DurationType, string>, ScrollItemWidget, ScrollItemWidget> setupItem = (option, tpl) =>
{ {
var item = ScrollItemWidget.Setup( var item = ScrollItemWidget.Setup(
tpl, tpl,
() => filter.Duration == option.Key, () => filter.Duration == option.First,
() => { filter.Duration = option.Key; ApplyFilter(); } () => { filter.Duration = option.First; ApplyFilter(); }
); );
item.Get<LabelWidget>("LABEL").GetText = () => option.Value; item.Get<LabelWidget>("LABEL").GetText = () => option.Second;
return item; return item;
}; };
@@ -277,25 +277,25 @@ namespace OpenRA.Mods.RA.Widgets.Logic
ddb.IsDisabled = () => string.IsNullOrEmpty(filter.PlayerName); ddb.IsDisabled = () => string.IsNullOrEmpty(filter.PlayerName);
// Using list to maintain the order // Using list to maintain the order
var options = new List<KeyValuePair<GameInformation.GameOutcome, string>> var options = new List<Pair<WinState, string>>
{ {
new KeyValuePair<GameInformation.GameOutcome, string>(GameInformation.GameOutcome.Undefined, ddb.GetText()), Pair.New(WinState.Undefined, ddb.GetText()),
new KeyValuePair<GameInformation.GameOutcome, string>(GameInformation.GameOutcome.Defeat, "Defeat"), Pair.New(WinState.Lost, "Defeat"),
new KeyValuePair<GameInformation.GameOutcome, string>(GameInformation.GameOutcome.Victory, "Victory") Pair.New(WinState.Won, "Victory")
}; };
var lookup = options.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); var lookup = options.ToDictionary(kvp => kvp.First, kvp => kvp.Second);
ddb.GetText = () => lookup[filter.Outcome]; ddb.GetText = () => lookup[filter.Outcome];
ddb.OnMouseDown = _ => ddb.OnMouseDown = _ =>
{ {
Func<KeyValuePair<GameInformation.GameOutcome, string>, ScrollItemWidget, ScrollItemWidget> setupItem = (option, tpl) => Func<Pair<WinState, string>, ScrollItemWidget, ScrollItemWidget> setupItem = (option, tpl) =>
{ {
var item = ScrollItemWidget.Setup( var item = ScrollItemWidget.Setup(
tpl, tpl,
() => filter.Outcome == option.Key, () => filter.Outcome == option.First,
() => { filter.Outcome = option.Key; ApplyFilter(); } () => { filter.Outcome = option.First; ApplyFilter(); }
); );
item.Get<LabelWidget>("LABEL").GetText = () => option.Value; item.Get<LabelWidget>("LABEL").GetText = () => option.Second;
return item; return item;
}; };
@@ -409,7 +409,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
button.IsDisabled = () => selectedReplay == null; button.IsDisabled = () => selectedReplay == null;
button.OnClick = () => button.OnClick = () =>
{ {
onDeleteReplay(selectedReplay, () => { if (selectedReplay == null) SelectFirstVisibleReplay(); }); onDeleteReplay(selectedReplay, () =>
{
if (selectedReplay == null)
SelectFirstVisibleReplay();
});
}; };
} }
@@ -514,7 +518,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
// Duration // Duration
if (filter.Duration != DurationType.Any) if (filter.Duration != DurationType.Any)
{ {
double minutes = replay.GameInfo.Duration.TotalMinutes; var minutes = replay.GameInfo.Duration.TotalMinutes;
switch (filter.Duration) switch (filter.Duration)
{ {
case DurationType.VeryShort: case DurationType.VeryShort:
@@ -551,7 +555,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return false; return false;
// Outcome // Outcome
if (filter.Outcome != GameInformation.GameOutcome.Undefined && filter.Outcome != player.Outcome) if (filter.Outcome != WinState.Undefined && filter.Outcome != player.Outcome)
return false; return false;
// Faction // Faction
@@ -582,7 +586,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
{ {
selectedReplay = replay; selectedReplay = replay;
selectedSpawns = (selectedReplay != null) selectedSpawns = (selectedReplay != null)
? LobbyUtils.GetSpawnClients(selectedReplay.GameInfo.Players, selectedReplay.GameInfo.MapPreview) ? LobbyUtils.GetSpawnOccupants(selectedReplay.GameInfo.Players, selectedReplay.GameInfo.MapPreview)
: new Dictionary<CPos, SpawnOccupant>(); : new Dictionary<CPos, SpawnOccupant>();
if (replay == null) if (replay == null)
@@ -680,7 +684,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public GameType Type; public GameType Type;
public DateType Date; public DateType Date;
public DurationType Duration; public DurationType Duration;
public GameInformation.GameOutcome Outcome; public WinState Outcome;
public string PlayerName; public string PlayerName;
public string MapName; public string MapName;
public string Faction; public string Faction;
@@ -692,7 +696,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return Type == default(GameType) return Type == default(GameType)
&& Date == default(DateType) && Date == default(DateType)
&& Duration == default(DurationType) && Duration == default(DurationType)
&& Outcome == default(GameInformation.GameOutcome) && Outcome == default(WinState)
&& string.IsNullOrEmpty(PlayerName) && string.IsNullOrEmpty(PlayerName)
&& string.IsNullOrEmpty(MapName) && string.IsNullOrEmpty(MapName)
&& string.IsNullOrEmpty(Faction); && string.IsNullOrEmpty(Faction);