Example #1
0
 public TableInspector(AStage yldr, bool waitDone)
 {
     this.IsDone        = false;
     this._waitDone     = waitDone;
     this._stageYielder = yldr;
     this._routine      = this._WaitUntileDone();
 }
Example #2
0
 public bool LoadCurrentMapResource(int nMapIndex, AStage kStage)
 {
     if (nMapIndex == this.nCurrentMapIndex)
     {
         return(false);
     }
     if (NrTSingleton <NrBaseTableManager> .Instance.GetMapInfo(nMapIndex.ToString()) == null)
     {
         return(false);
     }
     this.nCurrentMapIndex = nMapIndex;
     return(true);
 }
Example #3
0
        //quick test method, not final implementation
        private void DisplayStage(AStage Stage)
        {
            Label   lblBase;
            TextBox answer;

            this.Stage = Stage;
            //GroupBox grpbxProblemsGroup = new GroupBox();
            this.pnlGame.SuspendLayout();
            //grpbxProblemsGroup.Text = null;
            //grpbxProblemsGroup.Name = "grpbxProblemsGroup";
            //grpbxProblemsGroup.Size = this.pnlGame.Size;
            //grpbxProblemsGroup.Location = new System.Drawing.Point(0, 0);
            //create controls for each problem
            int vstartX = 260, startY = 60, ostartX = 280;
            int incX = 0, incY = 0;
            int maxProbCount = 2;

            this.StageTimer = this.Stage.TimeLimit;
            foreach (Problem p in Stage.Problems)
            {
                if (p.Values.Count() > maxProbCount)
                {
                    maxProbCount = p.Values.Count();
                }
            }
            int ansStart = vstartX + maxProbCount * 40;

            //int rgb = new Random().Next(Int32.MinValue, Int32.MaxValue);
            for (int p = 0; p < this.Stage.Problems.Count(); p++)
            {
                incX = 0;
                for (int v = 0; v < this.Stage.Problems[p].Values.Count(); v++)
                {
                    lblBase = new Label();
                    //lblBase.ForeColor = Color.FromArgb(rgb);
                    //lblBase.BackColor = Color.FromArgb(-rgb);
                    lblBase.Size      = new System.Drawing.Size(25, 25);
                    lblBase.Text      = this.Stage.Problems[p].Values[v].ToString();
                    lblBase.Name      = "lbl_Val" + v + "_Prob" + p;
                    lblBase.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                    lblBase.Location  = new System.Drawing.Point(vstartX + incX, startY + incY);
                    this.pnlGame.Controls.Add(lblBase);
                    incX += 40;
                }
                incX = 0;
                for (int o = 0; o < this.Stage.Problems[p].Operators.Count(); o++)
                {
                    lblBase = new Label();
                    //lblBase.ForeColor = Color.FromArgb(rgb);
                    //lblBase.BackColor = Color.FromArgb(-rgb);
                    lblBase.Size      = new System.Drawing.Size(25, 25);
                    lblBase.Text      = this.Stage.Problems[p].Operators[o].OperatorToString();
                    lblBase.Name      = "lbl_Op" + o + "_Prob" + p;
                    lblBase.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                    lblBase.Location  = new System.Drawing.Point(ostartX + incX, startY + incY);
                    this.pnlGame.Controls.Add(lblBase);
                    incX += 40;
                }
                //rgb = new Random().Next(Int32.MinValue,Int32.MaxValue);
                //Thread.Sleep(10);
                answer          = new TextBox();
                answer.TabIndex = p;
                answer.Text     = "0";
                answer.Size     = new System.Drawing.Size(80, 23);
                answer.Name     = "Ans" + p + "Prob" + p;
                answer.Location = new System.Drawing.Point(ansStart, startY + incY);
                this.pnlGame.Controls.Add(answer);

                incY += 30;
            }
            Button btnCheckAnswers = new Button();

            btnCheckAnswers.Name     = "btnCheckAnswers";
            btnCheckAnswers.Text     = "Check Answers";
            btnCheckAnswers.Location = new System.Drawing.Point(ansStart - 30, startY + incY);
            btnCheckAnswers.Size     = new System.Drawing.Size(140, 23);
            btnCheckAnswers.Click   += new System.EventHandler(this.btnCheckAnswers_Click);
            this.pnlGame.Controls.Add(btnCheckAnswers);

            lblTimer          = new Label();
            lblTimer.Name     = "lblTimer";
            lblTimer.Text     = StageTimer.ToString();
            lblTimer.Location = new System.Drawing.Point(ansStart - 100, startY + incY);
            lblTimer.Size     = new System.Drawing.Size(140, 23);
            this.pnlGame.Controls.Add(lblTimer);

            //this.pnlGame.Controls.Add(grpbxProblemsGroup);
            this.pnlGame.ResumeLayout();
            showStartQuizScreen();
            //this.pnlGame.Visible = true;
            //this.pnlSettings.Visible = false;
            //this.pnlMain.Visible = false;
            //this.pnlDifficultySelect.Visible = false;
        }
Example #4
0
 public MapLoader(AStage stg, MAP_INFO mapinfo)
 {
     this._stgYldr = stg;
     this._mapinfo = mapinfo;
 }