Example #1
0
 public Personage()
 {
     this.name          = names[Useful.random_Number(0, 7)];
     this.location      = new Location();
     this.age           = Useful.random_Number(18, 100);
     this.percentageDie = Useful.random_Number(0, 100);
 }
Example #2
0
        public void setBeliever()
        {
            int num = Useful.random_Number(0, 2);

            if (num == 0)
            {
                this.believer = false;
            }
            else
            {
                this.believer = true;
            }
        }
Example #3
0
        public void swapNeo(RichTextBox richText)
        {
            int  row, col;
            Cell c = whereIsNeo();

            row = Useful.random_Number(0, n);
            col = Useful.random_Number(0, n);
            Personage p = board[row, col];

            board[row, col]           = board[c.getX(), c.getY()];
            board[c.getX(), c.getY()] = p;
            this.text    += "Neo's position has changed \n";
            richText.Text = text;
            //Console.WriteLine("Neo cambia de posiciĆ³n");
        }
Example #4
0
        public void putNeoSmith()
        {
            Neo   neo   = new Neo();
            Smith smith = new Smith();
            int   row   = Useful.random_Number(0, n);
            int   col   = Useful.random_Number(0, n);

            if (board[row, col] == null)
            {
                board[row, col] = neo;
            }
            bool salir = false;

            do
            {
                row = Useful.random_Number(0, n);
                col = Useful.random_Number(0, n);
                if (board[row, col] == null)
                {
                    board[row, col] = smith;
                    salir           = true;
                }
            } while (!salir);
        }
Example #5
0
 public Location()
 {
     this.latitude  = Useful.random_Number(0, 100);
     this.longitude = Useful.random_Number(0, 100);
     this.city      = names[Useful.random_Number(0, 6)];
 }
Example #6
0
 public void setInfect(int max)
 {
     this.infect = Useful.random_Number(1, max + 1);
 }