fix: add creationDate on proposition

This commit is contained in:
Michel Roux 2024-01-27 23:05:27 +01:00
parent c8272c0b99
commit 927e0dfbb9
2 changed files with 13 additions and 2 deletions

View File

@ -8,4 +8,5 @@ public class Proposition
public string photoUrl;
public Player owner;
public string[] voters;
public double creationDate;
}

View File

@ -244,7 +244,12 @@ public void GeneratePrompts()
{
Dictionary<string, Proposition> propositions = new();
Player basePlayer = fullPlayers[0];
propositions.Add(Guid.NewGuid().ToString(), new Proposition() { owner = basePlayer });
propositions.Add(Guid.NewGuid().ToString(), new Proposition()
{
owner = basePlayer,
creationDate = DateTime.Now.ToOADate()
});
for (int i = 1; i < fullPlayers.Count(); i++)
{
@ -252,7 +257,12 @@ public void GeneratePrompts()
if (basePlayer.id != secondPlayer.id)
{
propositions.Add(Guid.NewGuid().ToString(), new Proposition() { owner = secondPlayer });
propositions.Add(Guid.NewGuid().ToString(), new Proposition()
{
owner = secondPlayer,
creationDate = DateTime.Now.ToOADate()
});
fullPlayers.RemoveAt(0);
break;
}