Added first code.

Signed-off-by: Naoriel Sa' Rocí <naoriel@sa-roci.de>
This commit is contained in:
2026-03-30 02:26:31 +02:00
parent bbf68e1621
commit 4a4fb54143
25 changed files with 1072 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
using System;
namespace EinmaleinsTrainer.Models;
public class Question : IEquatable<Question>
{
public int A { get; set; }
public int B { get; set; }
public int CorrectAnswer => A * B;
public bool Equals(Question? other)
{
if (other is null) return false;
return A == other.A &&
B == other.B;
}
public override bool Equals(object? obj)
{
return Equals(obj as Question);
}
public override int GetHashCode()
{
return HashCode.Combine(A, B);
}
public override string ToString()
{
return $"{A} x {B}";
}
}
+10
View File
@@ -0,0 +1,10 @@
using System.Collections.Generic;
namespace EinmaleinsTrainer.Models;
public class QuizModel
{
public List<Question> Questions { get; set; } = [];
public bool UseTimer { get; set; }
public int Seconds { get; set; } = 10;
}
+9
View File
@@ -0,0 +1,9 @@
using System;
namespace EinmaleinsTrainer.Models;
public class ResultModel
{
public int Score { get; set; } = 0;
public int Total { get; set; } = 0;
public TimeSpan? TimeRequired = null;
}