Boilerplate code reduced from factories, GetComponent() and GetControl() added to cfg-s

This commit is contained in:
Milan Hanajik
2015-01-02 19:14:19 +01:00
parent 94de991bf6
commit f2005bbf56
70 changed files with 367 additions and 708 deletions
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.PumpWithFM
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Elde.PumpWithFM
{
public string ClassName { get { return "PumpWithFM"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return int.MaxValue; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new PumpCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new PumpCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new Pump((PumpCfg)config, components);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PumpCfg), component, this);
}
public void ResetStaticProperties() { Pump.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new PumpCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PumpCfg), component, this);
}
}
}