using System; using System.Collections.Generic; using Iesi.Collections.Generic; using JetBrains.Annotations; using Portoa.Persistence; namespace VideoGameQuotes.Api { public class Game : Entity { private readonly Iesi.Collections.Generic.ISet systems = new HashedSet(); private readonly Iesi.Collections.Generic.ISet publishers = new HashedSet(); public Game() { Created = DateTime.UtcNow; } public virtual string Website { get; set; } public virtual User Creator { get; set; } public virtual DateTime Created { get; set; } public virtual IEnumerable Systems { get { return systems; } } public virtual string Name { get; set; } public virtual IEnumerable Publishers { get { return publishers; } } [CanBeNull] public virtual byte[] Screenshot { get; set; } public virtual Region Region { get; set; } #region adding and removing stuff public virtual Game AddSystem(GamingSystem system) { systems.Add(system); return this; } public virtual void ClearSystems() { systems.Clear(); } public virtual Game AddPublisher(Publisher publisher) { publishers.Add(publisher); return this; } public virtual void ClearPublishers() { publishers.Clear(); } #endregion } }