46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Iesi.Collections.Generic;
|
|
using JetBrains.Annotations;
|
|
using Portoa.Persistence;
|
|
|
|
namespace VideoGameQuotes.Api {
|
|
public class Game : Entity<Game, int> {
|
|
private readonly Iesi.Collections.Generic.ISet<GamingSystem> systems = new HashedSet<GamingSystem>();
|
|
private readonly Iesi.Collections.Generic.ISet<Publisher> publishers = new HashedSet<Publisher>();
|
|
|
|
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<GamingSystem> Systems { get { return systems; } }
|
|
public virtual string Name { get; set; }
|
|
public virtual IEnumerable<Publisher> 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
|
|
}
|
|
} |