else if (sender ==tbtnShiftLeft)
{
//Data
for (var y = 0; y < Pushmo.BitmapSize; y++)
{
byte tempbyte = gridControl.Bitmap[y][0];
Buffer.BlockCopy(gridControl.Bitmap[y], 1, gridControl.Bitmap[y], 0, Pushmo.BitmapSize - 1);
gridControl.Bitmap[y][Pushmo.BitmapSize - 1] = tempbyte;
}
//Objects
if (gridControl.Flag.X != 0xFF)
{
if (gridControl.Flag.X == 0)
gridControl.Flag.X = Pushmo.BitmapSize - 1;
else
gridControl.Flag.X--;
}
for (var i = 0; i < gridControl.PulloutSwitches.Length; i++)
{
if (gridControl.PulloutSwitches[i].X != 0xFF)
{
if (gridControl.PulloutSwitches[i].X == 0)
gridControl.PulloutSwitches[i].X = Pushmo.BitmapSize - 1;
else
gridControl.PulloutSwitches[i].X--;
}
if (gridControl.Manholes[i].X != 0xFF)
{
if (gridControl.Manholes[i].X == 0)
gridControl.Manholes[i].X = Pushmo.BitmapSize - 1;
else
gridControl.Manholes[i].X--;
}
}
}
else if (sender == tbtnShiftRight)
{
//Data
for (var y = 0; y < Pushmo.BitmapSize; y++)
{
var tempArray = new byte[Pushmo.BitmapSize];
Buffer.BlockCopy(gridControl.Bitmap[y], 0, tempArray, 0, Pushmo.BitmapSize);
Buffer.BlockCopy(tempArray, 0, gridControl.Bitmap[y], 1, Pushmo.BitmapSize - 1);
gridControl.Bitmap[y][0] = tempArray[Pushmo.BitmapSize - 1];
}
//Objects
if (gridControl.Flag.X != 0xFF)
{
if (gridControl.Flag.X == Pushmo.BitmapSize - 1)
gridControl.Flag.X = 0;
else
gridControl.Flag.X++;
}
for (var i = 0; i < gridControl.PulloutSwitches.Length; i++)
{
if (gridControl.PulloutSwitches[i].X != 0xFF)
{
if (gridControl.PulloutSwitches[i].X == Pushmo.BitmapSize - 1)
gridControl.PulloutSwitches[i].X = 0;
else
gridControl.PulloutSwitches[i].X++;
}
if (gridControl.Manholes[i].X != 0xFF)
{
if (gridControl.Manholes[i].X == Pushmo.BitmapSize - 1)
gridControl.Manholes[i].X = 0;
else
gridControl.Manholes[i].X++;
}
}
}