2024-04-04 22:57:07 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Utility
|
|
|
|
|
{
|
|
|
|
|
public enum Difficulty
|
|
|
|
|
{
|
|
|
|
|
Easy,
|
|
|
|
|
Medium,
|
|
|
|
|
Hard
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-05 19:24:26 +02:00
|
|
|
|
[Serializable]
|
2024-04-04 22:57:07 +02:00
|
|
|
|
public abstract class DifficultySettings
|
|
|
|
|
{
|
|
|
|
|
public Difficulty Difficulty { get; protected set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Faktor, wie viel mehr Zeit man halt als die Entwickler bei 100% effizienz benötigen.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double DaysUntilReleaseFactor { get; protected set; }
|
2024-04-05 19:24:26 +02:00
|
|
|
|
|
|
|
|
|
public double CaffeineDrainScaling { get; protected set; }
|
|
|
|
|
public double HungerDrainScaling { get; protected set; }
|
|
|
|
|
public double UrinationDrainScaling { get; protected set; }
|
2024-04-04 22:57:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class EasyDifficulty : DifficultySettings
|
|
|
|
|
{
|
|
|
|
|
public EasyDifficulty()
|
|
|
|
|
{
|
|
|
|
|
Difficulty = Difficulty.Easy;
|
|
|
|
|
DaysUntilReleaseFactor = 2.0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class MediumDifficulty : DifficultySettings
|
|
|
|
|
{
|
|
|
|
|
public MediumDifficulty()
|
|
|
|
|
{
|
|
|
|
|
Difficulty = Difficulty.Medium;
|
|
|
|
|
DaysUntilReleaseFactor = 1.5;
|
2024-04-05 19:24:26 +02:00
|
|
|
|
CaffeineDrainScaling = 1.5;
|
|
|
|
|
HungerDrainScaling = 1.5;
|
|
|
|
|
UrinationDrainScaling = 1.5;
|
2024-04-04 22:57:07 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class HardDifficulty : DifficultySettings
|
|
|
|
|
{
|
|
|
|
|
public HardDifficulty()
|
|
|
|
|
{
|
|
|
|
|
Difficulty = Difficulty.Hard;
|
|
|
|
|
DaysUntilReleaseFactor = 1.0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class DifficultyExtensions
|
|
|
|
|
{
|
|
|
|
|
public static DifficultySettings GetSettings(this Difficulty difficulty) => difficulty switch
|
|
|
|
|
{
|
|
|
|
|
Difficulty.Easy => new EasyDifficulty(),
|
|
|
|
|
Difficulty.Medium => new MediumDifficulty(),
|
|
|
|
|
Difficulty.Hard => new HardDifficulty(),
|
|
|
|
|
_ => throw new ArgumentOutOfRangeException(nameof(difficulty), difficulty, null)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static string GetName(this Difficulty difficulty) =>
|
|
|
|
|
difficulty switch
|
|
|
|
|
{
|
|
|
|
|
Difficulty.Easy => "Entspannt",
|
|
|
|
|
Difficulty.Medium => "Normal",
|
|
|
|
|
Difficulty.Hard => "Stressig",
|
|
|
|
|
_ => "Unbekannt"
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|