Free cookie consent management tool by TermsFeed Policy Generator

source: branches/SimulationCore/HeuristicLab.SimulationCore/3.3/DiscreteEvent/Activity.cs @ 10717

Last change on this file since 10717 was 10454, checked in by abeham, 11 years ago

#1610: updated core, implemented card game sample

File size: 1.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using HeuristicLab.Common;
4using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
5
6namespace HeuristicLab.SimulationCore {
7  [StorableClass]
8  public abstract class Activity<TModel> : IActivity<TModel> where TModel : IModel {
9    private IEventQueue<TModel> eventQueue;
10
11    [Storable]
12    public IEventQueue<TModel> EventQueue {
13      get { return eventQueue; }
14      protected set { eventQueue = value; }
15    }
16
17    public virtual IEnumerable<Type> MonitoredActions {
18      get { return new Type[0]; }
19    }
20
21    [StorableConstructor]
22    protected Activity(bool deserializing) { }
23    protected Activity(Activity<TModel> original, Cloner cloner) {
24      cloner.RegisterClonedObject(original, this);
25      eventQueue = cloner.Clone(original.eventQueue);
26    }
27    protected Activity(IEventQueue<TModel> queue) {
28      eventQueue = queue;
29    }
30
31    public abstract void ManageEvents(TModel model, IAction<TModel> lastAction);
32
33    public object Clone() { return Clone(new Cloner()); }
34    public abstract IDeepCloneable Clone(Cloner cloner);
35  }
36}
Note: See TracBrowser for help on using the repository browser.