refactor: Converted message data to its own struct

This commit is contained in:
Gerard Gascón 2024-01-27 15:42:31 +01:00
parent 1fc809141c
commit 9dd340eeb7
10 changed files with 339 additions and 18 deletions

View file

@ -0,0 +1,18 @@
using System.Collections.Generic;
namespace Messaging.MessageData {
public struct MessageData {
public KeyValuePair<string, string> QuestionMessage;
public KeyValuePair<string, string> AnswerMessage;
public MessageData(string text) {
string[] jokeParts = text.Split(':');
string[] question = jokeParts[0].Split('|');
string[] answer = jokeParts[1].Split('|');
QuestionMessage = new KeyValuePair<string, string>(question[0], question[1]);
AnswerMessage = new KeyValuePair<string, string>(answer[0], answer[1]);
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a53c45e3eeca441d81be59b5e03893bc
timeCreated: 1706365538