@@ -106,14 +106,38 @@ public Collection<Faction> getFactions() {
106106 }
107107
108108 /**
109- * Returns a list of all factions active in a specific year.
110- * @param date
111- * @return
109+ * Returns a collection of all active factions on the specified date, excluding Command factions.
110+ *
111+ * <p>A faction is considered active if it is valid for the given date and not marked as inactive. Command
112+ * factions (those whose short name contains a dot, {@code .}) are not included in the results.</p>
113+ *
114+ * @param date the date for which to check faction activity
115+ * @return a collection of active factions (excluding Commands) for the specified date
112116 */
113117 public Collection <Faction > getActiveFactions (LocalDate date ) {
114- return getFactions ().stream ().filter (f ->
115- f .validIn (date ) && !f .isInactive ())
116- .collect (Collectors .toList ());
118+ return getActiveFactions (date , false );
119+ }
120+
121+ /**
122+ * Returns a collection of all active factions on the specified date.
123+ *
124+ * <p>A faction is considered active if it is valid for the given date and not marked as inactive.</p>
125+ *
126+ * <p>If {@code includeCommands} is {@code false}, factions whose short name contains a dot ({@code .}) are
127+ * excluded, as these denote Commands rather than standard factions. If {@code includeCommands} is {@code true},
128+ * these Command factions are included in the results.</p>
129+ *
130+ * @param date the date for which to check faction activity
131+ * @param includeCommands whether to include Command factions (those whose short name contains a dot)
132+ *
133+ * @return a collection of active factions for the specified date, optionally including Commands
134+ */
135+ public Collection <Faction > getActiveFactions (LocalDate date , boolean includeCommands ) {
136+ return getFactions ().stream ()
137+ .filter (f -> f .validIn (date ))
138+ .filter (Faction ::isActive )
139+ .filter (f -> (includeCommands || !f .getShortName ().contains ("." )))
140+ .toList ();
117141 }
118142
119143 public Collection <String > getFactionList () {
0 commit comments