Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

end room now appears in stats #339

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions MapStatistics.cs
Expand Up @@ -12,11 +12,18 @@ public static class MapStatistics

public static int NumberOfStartRooms => Project.Current.Elements.OfType<Room>().Count(p => p.IsStartRoom);

public static int NumberOfEndRooms => Project.Current.Elements.OfType<Room>().Count(p => p.IsEndRoom);

public static string StartRoomName
{
get { foreach (var x in Project.Current.Elements.OfType<Room>()) { if (x.IsStartRoom) { return x.Name; } } return "(None)"; }
}

public static string EndRoomName
{
get { foreach (var x in Project.Current.Elements.OfType<Room>()) { if (x.IsEndRoom) { return x.Name; } } return "(None)"; }
}

public static int NumberOfFloatingRooms
{
get { return Project.Current.Elements.OfType<Room>().Count(p =>
Expand Down
8 changes: 8 additions & 0 deletions UI/MapStatisticsView.cs
Expand Up @@ -31,6 +31,14 @@ public string MapStatisticsString()
stats += $"No start room.";
stats += $"{Environment.NewLine}";

if (MapStatistics.NumberOfEndRooms == 1)
stats += $"End room = {MapStatistics.EndRoomName}";
else if (MapStatistics.NumberOfEndRooms == 2)
stats += $"More than one end room.";
else
stats += $"No end room.";
stats += $"{Environment.NewLine}";

stats += $"{Environment.NewLine}";
stats += $"# of Connections: {MapStatistics.NumberOfConnections}{Environment.NewLine}";
stats += $"# of Dangling Connections: {MapStatistics.NumberOfDanglingConnections}{Environment.NewLine}";
Expand Down