so-un-bot/legacy/Bot/Modules/OttoLinux/Question.cs

40 lines
956 B
C#
Raw Normal View History

2024-01-19 03:29:39 +01:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2024-01-31 03:24:59 +01:00
using Newtonsoft.Json;
2024-01-19 03:29:39 +01:00
2024-01-19 19:06:53 +01:00
namespace SoUnBot.Modules.OttoLinux
2024-01-19 03:29:39 +01:00
{
public class Question
{
2024-01-31 03:24:59 +01:00
[JsonProperty("quest")]
2024-01-19 03:29:39 +01:00
public String Quest { get; set; }
2024-01-31 03:24:59 +01:00
[JsonProperty("answers")]
2024-01-19 03:29:39 +01:00
public List<string> Answers { get; }
2024-01-31 03:24:59 +01:00
[JsonProperty("correct")]
2024-01-19 03:29:39 +01:00
public int Correct { get; private set; }
2024-01-31 04:56:23 +01:00
[JsonProperty("image")]
public string Image { get; private set; }
2024-01-19 03:29:39 +01:00
public Question(String quest)
{
Quest = quest;
Answers = new List<string>();
Correct = 0;
}
public void AddAnswer(String answer, bool correct)
{
Answers.Add(answer);
Correct = correct ? Answers.Count - 1 : Correct;
}
public void Append(String quest)
{
Quest += quest;
}
}
}