github
2073 of 3728 branches covered (55.61%)
Branch coverage included in aggregate %.
5 of 33 new or added lines in 2 files covered. (15.15%)
1893 existing lines in 244 files now uncovered.8612 of 12814 relevant lines covered (67.21%)
294447.88 hits per line
1 |
using Zilon.Core.Tactics; |
|
2 |
using Zilon.Core.Tactics.Behaviour;
|
|
3 |
|
|
4 |
namespace Zilon.Bot.Players.Triggers
|
|
5 |
{ |
|
6 |
public sealed class AndTrigger : ICompositLogicStateTrigger |
|
7 |
{ |
|
8 |
private readonly ILogicStateTrigger[] _triggers;
|
|
9 |
|
|
10 |
public AndTrigger(params ILogicStateTrigger[] triggers)
|
× |
UNCOV
11
|
{ |
× |
12 |
_triggers = triggers; |
× |
13 |
} |
× |
14 |
|
|
15 |
public void Reset() |
|
UNCOV
16
|
{ |
× |
17 |
foreach (var trigger in _triggers) |
|
UNCOV
18
|
{ |
× |
19 |
trigger.Reset(); |
× |
UNCOV
20
|
} |
× |
21 |
} |
× |
22 |
|
|
23 |
public bool Test(IActor actor, ISectorTaskSourceContext context, ILogicState currentState, |
|
24 |
ILogicStrategyData strategyData) |
|
UNCOV
25
|
{ |
× |
26 |
foreach (var trigger in _triggers) |
|
UNCOV
27
|
{ |
× |
28 |
if (!trigger.Test(actor, context, currentState, strategyData))
|
|
UNCOV
29
|
{ |
× |
30 |
return false; |
× |
31 |
} |
|
UNCOV
32
|
} |
× |
33 |
|
|
34 |
return true; |
× |
UNCOV
35
|
} |
× |
36 |
|
|
37 |
public void Update() |
|
UNCOV
38
|
{ |
× |
39 |
foreach (var trigger in _triggers) |
|
UNCOV
40
|
{ |
× |
41 |
trigger.Update(); |
× |
UNCOV
42
|
} |
× |
43 |
} |
× |
44 |
} |
|
45 |
} |