PatchworkLauncher.LaunchManager.Command_MovePatch C# (CSharp) Méthode

Command_MovePatch() public méthode

public Command_MovePatch ( int index, int offset ) : int
index int
offset int
Résultat int
		public int Command_MovePatch(int index, int offset) {

			if (index < 0 || index >= Instructions.Count) {
				throw new ArgumentException("Specified instruction was not in the sequence.");
			}
			var instruction = Instructions[index];
			var newIndex = index + offset;
			if (newIndex < 0 || newIndex >= Instructions.Count) {
				return index;
			}
			var oldOccupant = Instructions[newIndex];
			Instructions[index] = oldOccupant;
			Instructions[newIndex] = instruction;
			return newIndex;
		}