Line | |
---|
1 | using System;
|
---|
2 | using HeuristicLab.Common;
|
---|
3 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
4 |
|
---|
5 | namespace HeuristicLab.SimulationCore {
|
---|
6 | [StorableClass]
|
---|
7 | public abstract class Action<TModel> : IAction<TModel> where TModel : IModel {
|
---|
8 | public IActivity<TModel> Mandate { get; protected set; }
|
---|
9 |
|
---|
10 | [Storable]
|
---|
11 | private IActivity<TModel> StorableMandate {
|
---|
12 | get { return Mandate; }
|
---|
13 | set { Mandate = value; }
|
---|
14 | }
|
---|
15 |
|
---|
16 | [StorableConstructor]
|
---|
17 | protected Action(bool deserializing) { }
|
---|
18 | protected Action(Action<TModel> original, Cloner cloner) {
|
---|
19 | cloner.RegisterClonedObject(original, this);
|
---|
20 | Mandate = cloner.Clone(original.Mandate);
|
---|
21 | }
|
---|
22 | protected Action() { }
|
---|
23 | protected Action(IActivity<TModel> mandate) {
|
---|
24 | Mandate = mandate;
|
---|
25 | }
|
---|
26 |
|
---|
27 | public abstract void Execute(TModel model);
|
---|
28 |
|
---|
29 | public object Clone() { return Clone(new Cloner()); }
|
---|
30 | public abstract IDeepCloneable Clone(Cloner cloner);
|
---|
31 | }
|
---|
32 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.