using Newtonsoft.Json; using System; using System.Collections.Generic; [Serializable] [JsonObject] public class Proposition { public string photoUrl; public Player owner; public List voters; public double creationDate; [JsonConstructor] public Proposition(string _photoUrl, Player _owner, List _voters, double _creationDate) { photoUrl = _photoUrl; owner = null; voters = _voters; creationDate = _creationDate; } public Proposition() { photoUrl = string.Empty; owner = null; voters = new List(); creationDate = DateTime.Now.ToOADate(); } public Proposition(Player _player) { photoUrl = string.Empty; owner = _player; voters = new List(); creationDate = DateTime.Now.ToOADate(); } }