ported from perforce
This commit is contained in:
29
RobotAndDonkey.Game/Intents/NextGlitch.cs
Normal file
29
RobotAndDonkey.Game/Intents/NextGlitch.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RobotAndDonkey.Game.Execution;
|
||||
using RobotAndDonkey.Game.Execution.Results;
|
||||
using RobotAndDonkey.Game.GameState;
|
||||
|
||||
namespace RobotAndDonkey.Game.Intents;
|
||||
|
||||
public class NextGlitch : Intent
|
||||
{
|
||||
public override void Run(Guid requestId, CoreLoop coreLoop, List<Intent> newIntents, List<Result> results)
|
||||
{
|
||||
coreLoop.NextGlitch = (coreLoop.NextGlitch + 1) % coreLoop.GlitchDeck.Length;
|
||||
results.Add(new NextGlitchResult(requestId, coreLoop.NextGlitch));
|
||||
base.Run(requestId, coreLoop, newIntents, results);
|
||||
}
|
||||
|
||||
public override bool IsValid(CoreLoop coreLoop)
|
||||
{
|
||||
if (!base.IsValid(coreLoop))
|
||||
return false;
|
||||
|
||||
return coreLoop.RunPhase == ERunPhase.DrawGlitch;
|
||||
}
|
||||
|
||||
public override bool Immune => true;
|
||||
|
||||
public override string ToString() => "Next glitch, " + base.ToString();
|
||||
}
|
||||
Reference in New Issue
Block a user