public object Clone() { Block block = new Block(mShape, mType); block.mPosX = mPosX; block.mPosY = mPosY; block.mRot = mRot; return block; }
public static bool NewBlock() { if (mNextBlock == null) { mNextBlock = (Block)mBlocks[Math.Round(Math.Random() * 6)].Clone(); } mBlock = mNextBlock; Program.mStats[mBlock.mType - 1]++; if (Program.mStats[mBlock.mType - 1] > 1428) { Program.mStats[mBlock.mType - 1] = 1428; } // prevent overflow (also of the overall sum) Native.Renderer_RenderStats(); mNextBlock = (Block)mBlocks[Math.Round(Math.Random() * 6)].Clone(); bool success = Check(mBlock.mPosX, mBlock.mPosY, mBlock.mRot); Playfield.UpdateBlock(); Native.Renderer_RenderBlock(); if (Program.mShowNext) { Native.Renderer_RenderNextBlock(); } return success; }