using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chernobyl.Collections.Generic;
using Chernobyl.Collections.Generic.Event;
using Chernobyl.Collections.Generic.Hierarchy;
using Chernobyl.Mathematics.Geometry;
using Chernobyl.Values;
namespace Chernobyl.Mathematics.Space
{
///
/// An implementation of an that has a rectangular shape.
///
public class RectangleCell : Rectangle, ICell
{
///
/// Initializes a new instance of the class.
///
/// The horizontal width of the rectangle. This
/// value cannot be negative.
/// The vertical height of the rectangle. This
/// value cannot be negative.
/// The immediate superior of this node in the
/// hierarchy or null if this node has no superior.
/// The immediate subordinates of this node in
/// the hierarchy.
public RectangleCell(float width, float height, ICell parent, IEnumerable children)
{
Scale(width, height);
Children = new DecoratingEventCollection(new HierarchalChildren(this));
Parent = new HierarchalParent(this);
Parent.Value = parent;
Children.AddRange(children);
}
///
/// The immediate superior of this node in the hierarchy or null if this
/// node has no superior.
///
public IDynamicContainer Parent { get; private set; }
///
/// The immediate subordinates of this node in the hierarchy.
///
public IEventCollection Children { get; private set; }
}
}