@@ -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}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user