forked from cschladetsch/CsharpFlow
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKernel.cs
More file actions
42 lines (32 loc) · 705 Bytes
/
Kernel.cs
File metadata and controls
42 lines (32 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// (C) 2012 Christian Schladetsch. See http://www.schladetsch.net/flow/license.txt for Licensing information.
using System;
namespace Flow
{
internal class Kernel : Generator<bool>, IKernel
{
/// <inheritdoc />
public INode Root { get; set; }
/// <inheritdoc />
public new IFactory Factory { get; internal set; }
/// <inheritdoc />
public ITimeFrame Time { get { return _time; } }
internal Kernel(ITimeFrame timeFrame)
{
_time = timeFrame;
}
/// <inheritdoc />
public override void Step()
{
StepTime();
if (IsNullOrEmpty(Root))
return;
Root.Step();
Root.Post();
}
void StepTime()
{
_time.Step();
}
private readonly ITimeFrame _time;
}
}