private void saveItemOps(ref ITFigureItem item) { item.ShowingTimeSpan = mRTTar; item.ItemDirection = true; mItems.Add(item); }
public override List <ITFigureItem> GenItems() { List <ITFigureItem> retval = new List <ITFigureItem>(); for (int i = 0; i < 10; i++) { ITFigureItem item = new ITFigureItem(); item.ItemDirection = RandomBool(); item.ShowingTimeSpan = 500; retval.Add(item); } return(retval); }
//approaching steps public override void NextItem() { if (!mFirstTime) { if (mLastCorrect) { if (mDelta == 1)//direction changed { mCeiling = mRTTar; mFloor = mRTTar - mStepLen; if (mStepLen != 5) { mStepLen /= 2; } else { finishOneTrack(); } } mRTTar -= mStepLen; mDelta = -1; } else { if (mDelta == -1)//direction changed { mCeiling = mRTTar + mStepLen; mFloor = mRTTar; if (mStepLen != 5) { mStepLen /= 2; } else { finishOneTrack(); } } mRTTar += mStepLen; mDelta = 1; } } Console.Out.WriteLine(mRTTar); if (mRTTar < 5) { mRTTar = 5; } ITFigureItem item = new ITFigureItem(); if (RandomBool()) { mPage.ShowLeft(mRTTar); mLastLeft = true; saveItemOps(ref item); } else { mPage.ShowRight(mRTTar); mLastLeft = false; saveItemOps(ref item); } mFirstTime = false; m30Count++; }