public int WTick()
{
int wtime = 0;
tick++;
if (debug) R.GetSingeLayeImage().Save("I" + tick + ".png");
//Оброботка тика проводов
wtime += WTickWire();
//Оброботка тика блоков
for (int x = 0; x < WorldSizeX; x++)
{
for (int y = 0; y < WorldSizeY; y++)
{
for (int z = 0; z < WorldSizeZ; z++)
{
if (_objectMatrix[x, y, z].GetType() != typeof(RedstoneWire))
{
if (_objectMatrix[x, y, z].WTick()) wtime++;
}
}
}
}
wtime += WTickTorch();
//wtime += WTickTorch();
//wtime += WTickTorch();
//Обновление состояния портов
foreach (IoPort t in outPorts)
{
t.Value = _objectMatrix[t.X, t.Y, t.Z].RedValue > 0;
}
return wtime;
}