using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using Newtonsoft.Json;
namespace UseCases
{
public class Diagram
{
///
/// Initialize a new diagram with the default values.
///
public Diagram()
{
Version = new Version(1,0,0,0);
Actors = new List();
UseCases = new List();
Size = new Size(430, 372);
Maximized = false;
}
///
///
/// Initialize a new diagram with the default values and a specific size.
///
/// The size the diagram should be.
public Diagram(Size size) : this()
{
Size = size;
}
///
/// Initialize a new diagram with these values.
///
/// The version of the diagram
/// The actors in the diagram
/// The usecases in the diagram
/// The size of the diagram
/// Whether or not the window is maximized
public Diagram(Version version, List actors, List useCases, Size size, bool maximized)
{
Version = version;
Actors = actors;
UseCases = useCases;
Size = size;
Maximized = maximized;
}
///
/// All the drawable objects (Actors and UseCases) concatenated.
///
[JsonIgnore]
public IEnumerable Drawable => Actors.Cast().Concat(UseCases);
///
/// The version of the diagram
///
public Version Version { get; set; }
///
/// The actors in the diagram
///
public List Actors { get; set; }
///
/// The usecases in the diagram
///
public List UseCases { get; set; }
///
/// The size of the diagram
///
public Size Size { get; set; }
///
/// Wheter or not the diagram is maximized.
///
public bool Maximized { get; set; }
}
}