~ruther/NosSmooth

2583c9859bc45b634fc4bff5f64b049d560deec4 — Rutherther 2 years ago 9144925
feat(game): add check for combo skill
1 files changed, 24 insertions(+), 0 deletions(-)

A Core/NosSmooth.Game/Extensions/SkillInfoExtensions.cs
A Core/NosSmooth.Game/Extensions/SkillInfoExtensions.cs => Core/NosSmooth.Game/Extensions/SkillInfoExtensions.cs +24 -0
@@ 0,0 1,24 @@
//
//  SkillInfoExtensions.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using NosSmooth.Data.Abstractions.Infos;

namespace NosSmooth.Game.Extensions;

/// <summary>
/// Extension methods for <see cref="ISkillInfo"/>.
/// </summary>
public static class SkillInfoExtensions
{
    /// <summary>
    /// Check whether the given skill is a combo skill.
    /// </summary>
    /// <param name="skillInfo">The info about the skill.</param>
    /// <param name="morph">The morph to validate matches the morph of the skill.</param>
    /// <returns>Whether the skill is a combo skill.</returns>
    public static bool IsComboSkill(this ISkillInfo skillInfo, int? morph = default)
        => skillInfo.SpecialCost == 999 && skillInfo.CastId > 10 && (morph is null || skillInfo.MorphOrUpgrade == morph.Value);
}
\ No newline at end of file

Do not follow this link