1
This repository has been archived on 2025-03-15. You can view files and clone it, but cannot push or open issues or pull requests.
2025-03-15 20:02:21 +01:00

59 lines
2.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EvolutStudio
{
namespace tinysAPI
{
namespace BaseClasses
{
abstract public class BaseClassView : BaseClass
{
// private array list of components
protected ArrayList _components = new ArrayList();
#region Interface Functions
// public function to add a new sub view, returns array id
public int RegisterComponent(BaseClassComponent component)
{
// init sub view via presenter
modulInstance.Presenter.InitComponent(component);
// add sub view to array and return index
return _components.Add(component);
}
// public function to call ValidationSucceeded from all registered subviews
public void FireValidationSucceededEvent(string notification)
{
foreach (BaseClassComponent component in _components)
{
// update all values
modulInstance.Presenter.UpdateComponent(component);
// call delegate
component.ValidationSucceeded(notification);
}
}
// public function to call ValidationFailed from all registered subviews
public void FireValidationFailedEvent(string notification)
{
foreach (BaseClassComponent component in _components)
{
// update all values
modulInstance.Presenter.UpdateComponent(component);
// call delegate
component.ValidationSucceeded(notification);
}
}
#endregion
}
}
}
}