public void TheMoveScriptPointerCommandMovesTheScriptPointerByTheSpecifiedDistance() { SetUpScriptData(bw => { bw.Write(1); bw.Write(2); bw.Write(3); }); _programCounter.GetInteger().Should().Be(1); _programCounter.MoveScriptPointer(4); _programCounter.GetInteger().Should().Be(3); }
void MoveScriptPointerIfStackValueIsZero(IProgramCounter programCounter) { var distance = programCounter.GetInteger(); if (_stack.PopValue() == 0) { programCounter.MoveScriptPointer(distance); } }
bool ProcessDropSkipPauseNotZero(IProgramCounter programCounter) { var distance = programCounter.GetInteger(); var value = _stack.PopValue(); switch (value) { case (int)ScriptReturn.Continue: return(true); case (int)ScriptReturn.PauseRepeat: programCounter.MoveScriptPointer(distance - 4); return(false); case (int)ScriptReturn.Pause: return(false); } return(true); }
void MoveScriptPointerAlways(IProgramCounter programCounter) { var distance = programCounter.GetInteger(); programCounter.MoveScriptPointer(distance); }