29 lines
897 B
C#
29 lines
897 B
C#
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();
|
|
} |