コード例 #1
0
ファイル: Personage.cs プロジェクト: RosaLn/RealWorld
 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);
 }
コード例 #2
0
ファイル: Neo.cs プロジェクト: RosaLn/RealWorld
        public void setBeliever()
        {
            int num = Useful.random_Number(0, 2);

            if (num == 0)
            {
                this.believer = false;
            }
            else
            {
                this.believer = true;
            }
        }
コード例 #3
0
ファイル: Matrix.cs プロジェクト: RosaLn/RealWorld
        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");
        }
コード例 #4
0
ファイル: Matrix.cs プロジェクト: RosaLn/RealWorld
        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);
        }
コード例 #5
0
ファイル: Personage.cs プロジェクト: RosaLn/RealWorld
 public Location()
 {
     this.latitude  = Useful.random_Number(0, 100);
     this.longitude = Useful.random_Number(0, 100);
     this.city      = names[Useful.random_Number(0, 6)];
 }
コード例 #6
0
 public void setInfect(int max)
 {
     this.infect = Useful.random_Number(1, max + 1);
 }