Files
BarotraumaModServer/LocalMods/More Level Content/CSharp/Shared/Generation/Defs/DefWithDifficultyRange.cs
2026-06-09 00:42:10 +03:00

22 lines
991 BLFS
C#
Executable File

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace MoreLevelContent.Shared.Generation
{
public abstract class DefWithDifficultyRange : IComparable<DefWithDifficultyRange>
{
protected DefWithDifficultyRange(string stringContainingDiff) => DifficultyRange = new DifficultyRange(stringContainingDiff);
protected DefWithDifficultyRange(float min, float max) => DifficultyRange = new DifficultyRange(min, max);
public float MinDifficulty => DifficultyRange.MinDiff;
public float MaxDifficulty => DifficultyRange.MaxDiff;
public float AverageDifficulty => (MinDifficulty + MaxDifficulty) / 2;
public DifficultyRange DifficultyRange { get; protected set; }
public int CompareTo([AllowNull] DefWithDifficultyRange other) => other == null ? -1 : other.MinDifficulty < MinDifficulty ? -1 : other.MinDifficulty == MinDifficulty ? 0 : 1;
}
}