public void GetFigurePathAndControllerType(out AbstractFigureController controller, out string path) { GenerateNextFigure(); int counter = 0; foreach(KeyValuePair<System.Type, string> elem in mFiguresDictionary) { if (counter == mNextFigureIndex) { controller = System.Activator.CreateInstance(elem.Key) as AbstractFigureController; path = elem.Value; return; } counter++; } controller = null; path = null; }
void SetCurentFigure() { if (mFigure0 != mCurentFigure) { mCurentFigureController = mNextFigureController; mFigure0.transform.position = new Vector2(0, 22); mCurentFigureController.SetFigure(mFigure0); mCurentFigureController.FigureDropped += CheckFullLines; } else { mCurentFigureController = mNextFigureController; mFigure1.transform.position = new Vector2(0, 22); mCurentFigureController.SetFigure(mFigure1); mCurentFigureController.FigureDropped += CheckFullLines; } CreateFigure(); }
public void GetFigurePathAndControllerType(out AbstractFigureController controller, out string path) { GenerateNextFigure(); int counter = 0; foreach (KeyValuePair <System.Type, string> elem in mFiguresDictionary) { if (counter == mNextFigureIndex) { controller = System.Activator.CreateInstance(elem.Key) as AbstractFigureController; path = elem.Value; return; } counter++; } controller = null; path = null; }
void SetCurentFigure() { if(mFigure0 != mCurentFigure) { mCurentFigureController = mNextFigureController; mFigure0.transform.position = new Vector2(0, 22); mCurentFigureController.SetFigure(mFigure0); mCurentFigureController.FigureDropped += CheckFullLines; } else { mCurentFigureController = mNextFigureController; mFigure1.transform.position = new Vector2(0, 22); mCurentFigureController.SetFigure(mFigure1); mCurentFigureController.FigureDropped += CheckFullLines; } CreateFigure(); }