01.10.2020

+ Time controls (Stopwatch, Timers, Intervals)
+ Added smmeries to everything in SM.Base

~ Renamed Vectors to CVectors.
This commit is contained in:
Michel Fedde 2020-10-01 15:39:03 +02:00
parent 7acdba92f8
commit 97e638d9d9
44 changed files with 1092 additions and 289 deletions

View file

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