Skip to content

Commit

Permalink
Added subcategory for ModuleEnginesAJEJet
Browse files Browse the repository at this point in the history
Updated NamesAndIcons and 02_Engines to support the new AJE Jets
Added new check to support checking the engine type
Added ability to filter on partial part name
Added configs for AJE jets and propellers
Added configs for Airplane+ propellers
Added new categories for engines:
	Prop engines
	Electric prop engines
Added some additional filters for the various Firespitter engines
  • Loading branch information
linuxgurugamer committed Jan 14, 2018
1 parent 427a386 commit 4f667f8
Show file tree
Hide file tree
Showing 16 changed files with 413 additions and 231 deletions.
10 changes: 9 additions & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,12 @@

3.2.0.3
Added subcategory for ModuleEnginesAJEJet
Updated NamesAndIcons and 02_Engines to support the new AJE Jets
Updated NamesAndIcons and 02_Engines to support the new AJE Jets
Added new check to support checking the engine type
Added ability to filter on partial part name
Added configs for AJE jets and propellers
Added configs for Airplane+ propellers
Added new categories for engines:
Prop engines
Electric prop engines
Added some additional filters for the various Firespitter engines
Binary file removed FilterExtension/.FilterExtensions.csproj.swp
Binary file not shown.
31 changes: 31 additions & 0 deletions FilterExtension/ConfigNodes/CheckNodes/CheckNodeExtended.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ public override ConfigNode ToConfigNode()
}
}

/// <summary>
/// part name check
/// </summary>
public class CheckName : CheckNodeExtended
{
public const string ID = "name";
public override string CheckID { get => ID; }
bool exact = true;
public CheckName(ConfigNode node) : base(node)
{
if (node.HasValue("exact"))
exact = Exact;
}
public override bool CheckResult(AvailablePart part, int depth = 0)
{
return Invert ^ PartType.CheckName(part, Values, exact);
}
}
/// <summary>
/// part module name
/// </summary>
Expand Down Expand Up @@ -112,6 +130,19 @@ public override bool CheckResult(AvailablePart part, int depth = 0)
}
}

/// <summary>
/// checks engine type
/// </summary>
public class CheckEngineType : CheckNodeExtended
{
public const string ID = "engineType";
public override string CheckID { get => ID; }
public CheckEngineType(ConfigNode node) : base(node) { }
public override bool CheckResult(AvailablePart part, int depth = 0)
{
return Invert ^ PartType.CheckEngineType(part, Values, Contains, Exact);
}
}
public class CheckGroup : CheckNode
{
public const string ID = "check";
Expand Down
3 changes: 3 additions & 0 deletions FilterExtension/ConfigNodes/CheckNodes/CheckNodeFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public static CheckNode MakeCheck(ConfigNode node)
return new CheckResource(node);
case CheckPropellant.ID:
return new CheckPropellant(node);
case CheckEngineType.ID:
return new CheckEngineType(node);
case CheckGroup.ID:
return new CheckGroup(node);
case CheckSize.ID:
Expand All @@ -55,6 +57,7 @@ public static CheckNode MakeCheck(ConfigNode node)
return new CheckCost(node);
default:
Logger.Log($"unknown check type {checkID}", Logger.LogLevel.Error);
Logger.Log($"CheckEnginetype.ID: " + CheckEngineType.ID, Logger.LogLevel.Error);
return null;
}
}
Expand Down
5 changes: 3 additions & 2 deletions FilterExtension/ConfigNodes/CheckNodes/CheckNodeSimple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

namespace FilterExtensions.ConfigNodes.CheckNodes
{
#if false
/// <summary>
/// part name check
/// </summary>
public class CheckName : CheckNode
public class CheckName : CheckNodeExtended
{
public const string ID = "name";
public override string CheckID { get => ID; }
Expand All @@ -19,7 +20,7 @@ public override bool CheckResult(AvailablePart part, int depth = 0)
return Invert ^ PartType.CheckName(part, Values);
}
}

#endif
/// <summary>
/// Part title check
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion FilterExtension/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace FilterExtensions
{
internal static class Logger
{
public static readonly Version version = new Version(3, 0, 1);
public static readonly Version version = new Version(3,2,0,3);
public static readonly string versionString = $"[Filter Extensions {version}]:";

internal enum LogLevel
Expand Down
Loading

0 comments on commit 4f667f8

Please sign in to comment.