Example #1
0
        public void swapNeo()
        {
            Cell n   = whereIsNeo();
            int  neX = n.getx();
            int  neY = n.gety();

            int newX = Usefuls.random_Number(0, 5);
            int newY = Usefuls.random_Number(0, 5);

            if (this.board[newX, newY] != null)
            {
                if (this.board[newX, newY] is Smith)
                {
                    Smith aux = (Smith)this.board[newX, newY];
                    this.board[newX, newY] = this.neo;
                    this.board[neX, neY]   = aux;
                }
                else
                {
                    Personages aux = this.board[newX, newY];
                    this.board[newX, newY] = this.neo;
                    this.board[neX, neY]   = aux;
                }
            }
            else
            {
                this.board[newX, newY] = this.neo;
                this.board[neX, neY]   = null;
            }
        }
 public Personages()
 {
     this.name          = names[Usefuls.random_Number(0, 7)];
     this.age           = Usefuls.random_Number(1, 100);
     this.percentageDie = Usefuls.random_Number(1, 101);
     this.location      = new Location();
 }
Example #3
0
        public bool isBelieved()
        {
            int num = Usefuls.random_Number(0, 2);

            if (num == 0)
            {
                this.believed = false;
            }
            else
            {
                this.believed = true;
            }

            return(this.believed);
        }
Example #4
0
        public void putNeoSmith()
        {
            int smF  = Usefuls.random_Number(0, 5);
            int smC  = Usefuls.random_Number(0, 5);
            int neoF = Usefuls.random_Number(0, 5);
            int neoC = Usefuls.random_Number(0, 5);



            this.board[neoF, neoC] = this.neo;

            bool put = false;

            while (!put)
            {
                if (this.board[smF, smC] == null)
                {
                    this.board[smF, smC] = this.smith;
                    put = true;
                }
                smF = Usefuls.random_Number(0, 5);
                smC = Usefuls.random_Number(0, 5);
            }
        }
Example #5
0
 public int getInfect()
 {
     return(Usefuls.random_Number(1, this.MAX));
 }
 public Location()
 {
     this.city      = cities[Usefuls.random_Number(0, 7)];
     this.latitude  = Usefuls.random_Number(0, 91);
     this.longitude = Usefuls.random_Number(0, 360);
 }