Added missing summeries #1
This commit is contained in:
parent
03d99ea28e
commit
8665b5b709
104 changed files with 1165 additions and 821 deletions
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using OpenTK;
|
||||
using SM.Base;
|
||||
using SM.Base.Drawing;
|
||||
using SM.Base.Windows;
|
||||
using SM.Base.Window;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
@ -16,12 +14,17 @@ namespace SM.Base.Scene
|
|||
/// </summary>
|
||||
public abstract class GenericItemCollection : List<IShowItem>, IShowItem, IShowCollection, IScriptable
|
||||
{
|
||||
private List<IScriptable> _scriptableObjects = new List<IScriptable>();
|
||||
private readonly List<IScriptable> _scriptableObjects = new List<IScriptable>();
|
||||
|
||||
/// <summary>
|
||||
/// Currently active script objects.
|
||||
/// </summary>
|
||||
public ReadOnlyCollection<IScriptable> ScriptableObjects => new ReadOnlyCollection<IScriptable>(_scriptableObjects);
|
||||
public ReadOnlyCollection<IScriptable> ScriptableObjects =>
|
||||
new ReadOnlyCollection<IScriptable>(_scriptableObjects);
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool UpdateActive { get; set; } = true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public List<IShowItem> Objects => this;
|
||||
|
||||
|
|
@ -32,23 +35,13 @@ namespace SM.Base.Scene
|
|||
public string Name { get; set; } = "Unnamed Item Collection";
|
||||
|
||||
/// <inheritdoc />
|
||||
public ICollection<string> Flags { get; set; } = new List<string>() {"collection"};
|
||||
public ICollection<string> Flags { get; set; } = new List<string> {"collection"};
|
||||
|
||||
/// <inheritdoc cref="IShowItem" />
|
||||
public bool Active { get; set; } = true;
|
||||
public bool UpdateActive { get; set; } = true;
|
||||
public bool RenderActive { get; set; } = true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void Update(UpdateContext context)
|
||||
{
|
||||
if (!Active || !UpdateActive) return;
|
||||
|
||||
for (var i = 0; i < _scriptableObjects.Count; i++)
|
||||
{
|
||||
if (!_scriptableObjects[i].Active || !_scriptableObjects[i].UpdateActive) continue;
|
||||
_scriptableObjects[i].Update(context);
|
||||
}
|
||||
}
|
||||
/// <inheritdoc />
|
||||
public bool RenderActive { get; set; } = true;
|
||||
|
||||
/// <inheritdoc cref="IShowCollection.Draw" />
|
||||
public virtual void Draw(DrawContext context)
|
||||
|
|
@ -62,6 +55,18 @@ namespace SM.Base.Scene
|
|||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void Update(UpdateContext context)
|
||||
{
|
||||
if (!Active || !UpdateActive) return;
|
||||
|
||||
for (var i = 0; i < _scriptableObjects.Count; i++)
|
||||
{
|
||||
if (!_scriptableObjects[i].Active || !_scriptableObjects[i].UpdateActive) continue;
|
||||
_scriptableObjects[i].Update(context);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void OnAdded(object sender)
|
||||
{
|
||||
|
|
@ -75,7 +80,7 @@ namespace SM.Base.Scene
|
|||
/// <summary>
|
||||
/// Adds a item to the draw and the script collection, when applicable.
|
||||
/// </summary>
|
||||
public new void Add(params IShowItem[] items)
|
||||
public void Add(params IShowItem[] items)
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
|
|
@ -87,7 +92,7 @@ namespace SM.Base.Scene
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the object to the collection.
|
||||
/// Adds the object to the collection.
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
public void AddObject(IShowItem item)
|
||||
|
|
@ -96,8 +101,9 @@ namespace SM.Base.Scene
|
|||
item.Parent = this;
|
||||
item.OnAdded(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the script to the collection.
|
||||
/// Adds the script to the collection.
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
public void AddScript(IScriptable item)
|
||||
|
|
@ -105,7 +111,7 @@ namespace SM.Base.Scene
|
|||
_scriptableObjects.Add(item);
|
||||
}
|
||||
|
||||
public new void Remove(params IShowItem[] items)
|
||||
public void Remove(params IShowItem[] items)
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
|
|
@ -117,7 +123,7 @@ namespace SM.Base.Scene
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove the object from the draw collection.
|
||||
/// Remove the object from the draw collection.
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
public void RemoveObject(IShowItem item)
|
||||
|
|
@ -128,7 +134,7 @@ namespace SM.Base.Scene
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove the object from the script collection.
|
||||
/// Remove the object from the script collection.
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
public void RemoveScript(IScriptable item)
|
||||
|
|
@ -139,7 +145,7 @@ namespace SM.Base.Scene
|
|||
public ICollection<IShowItem> GetAllItems(bool includeCollections = false)
|
||||
{
|
||||
List<IShowItem> items = new List<IShowItem>();
|
||||
for (var i = 0; i < this.Count; i++)
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
if (!includeCollections && this[i] is IShowCollection) continue;
|
||||
items.Add(this[i]);
|
||||
|
|
@ -201,7 +207,8 @@ namespace SM.Base.Scene
|
|||
/// </summary>
|
||||
/// <typeparam name="TItem">The type of show items.</typeparam>
|
||||
/// <typeparam name="TTransformation">The type of transformation.</typeparam>
|
||||
public abstract class GenericItemCollection<TTransformation> : GenericItemCollection, IShowTransformItem<TTransformation>
|
||||
public abstract class GenericItemCollection<TTransformation> : GenericItemCollection,
|
||||
IShowTransformItem<TTransformation>
|
||||
where TTransformation : GenericTransformation, new()
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue