using System.Collections.Generic;
using SM.Base.Contexts;
namespace SM.Base.Scene
{
///
/// Contains a list of show items.
///
/// The type of show items.
public abstract class GenericItemCollection : IShowItem, IShowCollection
where TItem : IShowItem
{
///
public List Objects { get; } = new List();
///
public void Update(UpdateContext context)
{
throw new System.NotImplementedException();
}
///
public virtual void Draw(DrawContext context)
{
for (int i = 0; i < Objects.Count; i++)
Objects[i].Draw(context);
}
}
///
/// Contains a list of show items with transformation.
///
/// The type of show items.
/// The type of transformation.
public abstract class GenericItemCollection : GenericItemCollection
where TItem : IShowItem
where TTransformation : GenericTransformation, new()
{
///
/// Transformation of the collection
///
public TTransformation Transform = new TTransformation();
///
public override void Draw(DrawContext context)
{
context.View = Transform.GetMatrix() * context.View;
base.Draw(context);
}
}
}