- Marked tasks as complete in the decision-making phase documentation, indicating readiness for implementation. - Updated the README to reflect the completion status of the decision-making phase. - Enhanced localization strings to include new presence tracking features, improving user experience. - Revised the game screen logic to display real-time presence status, including walking states for individuals. - Added tests to validate the new localization strings and presence functionalities, ensuring robust performance.
33 lines
939 B
C#
33 lines
939 B
C#
using HSchool.Content;
|
|
|
|
namespace HSchool.Ai.Tests;
|
|
|
|
public class LessonLearningTests
|
|
{
|
|
private static readonly SkillDef Math = new()
|
|
{
|
|
DefName = "Mathematics",
|
|
Range = new IntRange { Min = 0, Max = 100 },
|
|
};
|
|
|
|
[Fact]
|
|
public void HungryLearnsLessThanFull()
|
|
{
|
|
var full = LessonLearning.Gain(50, Math, share: 1, lessonSkillPerHour: 0.05f, hours: 0.75f, hunger: 1f, traitOffset: 0);
|
|
var hungry = LessonLearning.Gain(50, Math, share: 1, lessonSkillPerHour: 0.05f, hours: 0.75f, hunger: 0.1f, traitOffset: 0);
|
|
|
|
Assert.True(full > 50);
|
|
Assert.True(hungry > 50);
|
|
Assert.True(full - 50 > hungry - 50);
|
|
}
|
|
|
|
[Fact]
|
|
public void DiligentOffset_RaisesTheGain()
|
|
{
|
|
var plain = LessonLearning.Gain(50, Math, 1, 0.05f, 1f, 1f, 0);
|
|
var diligent = LessonLearning.Gain(50, Math, 1, 0.05f, 1f, 1f, 8);
|
|
|
|
Assert.True(diligent > plain);
|
|
}
|
|
}
|