Skip to content

Commit

Permalink
Lets have some stats
Browse files Browse the repository at this point in the history
  • Loading branch information
AffectedArc07 committed Apr 10, 2024
1 parent cb303bd commit 776e31d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions SS13WebMap/CodebaseData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,5 +1001,30 @@ public class CodebaseData {
}
} },
};

/// <summary>
/// Sum of all codebases. This is done here as a static to not cause runtime load.
/// </summary>
public static int TotalCodebases = Codebases.Count;

/// <summary>
/// Sum of all maps. This is done here as a static to not cause runtime load.
/// </summary>
public static int TotalMaps = Codebases.Sum(x => x.Value.GameMaps.Count);

/// <summary>
/// Sum of total normal layers. This is done here as a static to not cause runtime load.
/// </summary>
private static int TotalNormalLayers = Codebases.Where(x => !x.Value.FancySupport).Sum(x => x.Value.GameMaps.Sum(x => x.Layers.Count));

/// <summary>
/// Sum of total fancy layers, which is the above but counting fancy, then multiplying by 2. This is done here as a static to not cause runtime load.
/// </summary>
private static int TotalFancyLayers = Codebases.Where(x => x.Value.FancySupport).Sum(x => x.Value.GameMaps.Sum(x => x.Layers.Count)) * 2;

/// <summary>
/// Sum of total layers. This is done here as a static to not cause runtime load.
/// </summary>
public static int TotalLayers = TotalNormalLayers + TotalFancyLayers;
}
}
1 change: 1 addition & 0 deletions SS13WebMap/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<h1 class="display-1 text-white">SS13 WebMap</h1>
<p class="text-white"><b>Created by AffectedArc07</b></p>
<p class="text-white">Special thanks to <b>Letter_N</b> for HTML theming and JS support.</p>
<p class="text-white">Currently holding <b>@CodebaseData.TotalCodebases</b> codebases with <b>@CodebaseData.TotalMaps</b> maps, and a total of <b>@CodebaseData.TotalLayers</b> layers.</p>
<a class="btn btn-primary" target="_blank" href="https://github.com/AffectedArc07/SS13WebMap"><i class="fab fa-github"></i>&nbsp;&nbsp;GitHub</a>
<a class="btn btn-primary" target="_blank" href="https://github.com/AffectedArc07/SS13WebMap/tree/master/MAP_REQUESTING.MD"><i class="fas fa-folder-plus"></i>&nbsp;&nbsp;How to get your map on here</a>
<a class="btn btn-primary" target="_blank" href="https://onlyfaans.net/"><i class="fas fa-pound-sign"></i>&nbsp;&nbsp;Donate</a>
Expand Down

0 comments on commit 776e31d

Please sign in to comment.