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

            int newX = Useful.random_Number(0, 5);
            int newY = Useful.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
                {
                    Personage 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;
            }
        }
Beispiel #2
0
        public Personage()
        {
            int pj = Useful.random_Number(0, names.Count() - 1);

            this.name          = names[pj];
            this.image         = addImageResize(pj);
            this.age           = Useful.random_Number(1, 100);
            this.percentageDie = Useful.random_Number(1, 101);
            this.location      = new Location();
        }
Beispiel #3
0
        public bool isBelieved()
        {
            int num = Useful.random_Number(0, 2);

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

            return(this.believed);
        }
        public void putNeoSmith()
        {
            int smF  = Useful.random_Number(0, 5);
            int smC  = Useful.random_Number(0, 5);
            int neoF = Useful.random_Number(0, 5);
            int neoC = Useful.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 = Useful.random_Number(0, 5);
                smC = Useful.random_Number(0, 5);
            }
        }
Beispiel #5
0
 public Location()
 {
     this.city      = cities[Useful.random_Number(0, 7)];
     this.latitude  = Useful.random_Number(0, 91);
     this.longitude = Useful.random_Number(0, 360);
 }
Beispiel #6
0
 public int getInfect()
 {
     return(Useful.random_Number(1, this.MAX));
 }