BinhlEmul.World.WTick C# (CSharp) Method

WTick() public method

public WTick ( ) : int
return int
        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;
        }

Usage Example

コード例 #1
0
ファイル: Program.cs プロジェクト: Gl237man/mineroute
 private static void FSWait(World world, string str)
 {
     int twait = 1;
     while (twait > 0)
     {
         twait = world.WTick();
     }
 }