Ejemplo n.º 1
0
        private void GetMurder()
        {
            Murder = new List<Card>();
            JimRandom Random = new JimRandom();

            //Get Crime Scene
            int place = Random.Next(1, 10);
            Card Scene = Rooms.Find(x => x.ID == place);

            //Get Murder Weapon
            int w = Random.Next(1, 7);
            Card Weapon = Weapons.Find(x => x.ID == w);

            //Get Victim
            int v = Random.Next(1, 7);
            Card Victim = Suspects.Find(x => x.ID == v);

            Murder.Add(Scene);
            Murder.Add(Weapon);
            Murder.Add(Victim);
        }
Ejemplo n.º 2
0
        private void RollDice()
        {
            ResetTiles();
            JimRandom Random = new JimRandom();

            //Roll DIce 1
            int dice1 = Random.Next(1, 7);
            //Roll DIce 2
            int dice2 = Random.Next(1, 7);

            Roll = dice1 + dice2;

            //Set Dice images
            pbDice1.BackgroundImage = Roller[dice1 - 1].Picture;
            pbDice2.BackgroundImage = Roller[dice2 - 1].Picture;

            btnRoll.Enabled = false;

            Test(Roll);

            ////Show available moves
            //Control[] lCurrent = PnlBoard.Controls.Find("pnl" + CurrentPlauer, true);
            //Panel Current = null;
            //System.Drawing.Point CurrentLoc = new System.Drawing.Point(0, 0);
            //foreach (Control c in lCurrent)
            //{
            //    Current = c as Panel;
            //    CurrentLoc = new System.Drawing.Point(c.Location.X, c.Location.Y);
            //}

            ////Dynamic map
            //List<string> possiblities = new List<string>();
            //int currentRow = CurrentLoc.Y / tileWidth;
            //int currentCol = CurrentLoc.X / tileHeight;

            ////Find all possible start blocks
            //string down = String.Format("Col={0:00}-Row={1:00}", currentCol, currentRow + 1);
            //string up = String.Format("Col={0:00}-Row={1:00}", currentCol, currentRow - 1);
            //string left = String.Format("Col={0:00}-Row={1:00}", currentCol - 1, currentRow);
            //string right = String.Format("Col={0:00}-Row={1:00}", currentCol + 1, currentRow);

            //List<string> startBlocks = new List<string>();

            ////See if down is available
            //Control[] LPossible = PnlBoard.Controls.Find(down, true);
            //if (LPossible.Length > 0)
            //{
            //    startBlocks.Add(down);
            //}

            ////See if Up is available
            //LPossible = PnlBoard.Controls.Find(up, true);
            //if (LPossible.Length > 0)
            //{
            //    startBlocks.Add(up);
            //}

            ////See if left is available
            //LPossible = PnlBoard.Controls.Find(left, true);
            //if (LPossible.Length > 0)
            //{
            //    startBlocks.Add(left);
            //}

            ////See if right is available
            //LPossible = PnlBoard.Controls.Find(right, true);
            //if (LPossible.Length > 0)
            //{
            //    startBlocks.Add(right);
            //}

            ////possiblilities 1
            //foreach (string s in startBlocks)
            //{
            //    Control[] lStarBlock = PnlBoard.Controls.Find(s, true);
            //    PictureBox startBlock = lStarBlock[0] as PictureBox;

            //    int sRow = startBlock.Location.Y / tileWidth;
            //    int sCol = startBlock.Location.X / tileHeight;

            //    //Rows
            //    for (int row = sRow; row < sRow + Roll; row++)
            //    {
            //        //Columns
            //        for (int col = sCol; col < sCol + Roll; col++)
            //        {
            //            possiblities.Add(String.Format("Col={0:00}-Row={1:00}", col, row));
            //        }
            //    }

            //    ////Rows
            //    //for (int row = sRow - Roll; row > sRow; row--)
            //    //{
            //    //    //Columns
            //    //    for (int col = sCol - Roll; col > sCol; col--)
            //    //    {
            //    //        possiblities.Add(String.Format("Col={0:00}-Row={1:00}", col, row));
            //    //    }
            //    //}

            //}

            ////Show possible moves
            //foreach (string p in possiblities)
            //{
            //    LPossible = PnlBoard.Controls.Find(p, true);
            //    if (LPossible.Length > 0)
            //    {
            //        PictureBox active = LPossible[0] as PictureBox;
            //        active.Image = Cluedo.Properties.Resources.TileActive;
            //        System.Threading.Thread.Sleep(1);
            //        Application.DoEvents();
            //    }
            //    //else
            //    //{
            //    //    break;
            //    //}
            //}
        }
Ejemplo n.º 3
0
        private void RollDice()
        {
            JimRandom Random = new JimRandom();

            //Roll DIce 1
            int dice1 = Random.Next(1, 7);
            //Roll DIce 2
            int dice2 = Random.Next(1, 7);

            Roll = dice1 + dice2;

            //Test code
            pictureBox4.BackgroundImage = Roller[dice1 - 1].Picture;
            pictureBox5.BackgroundImage = Roller[dice2 - 1].Picture;
        }