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 Matrix() { neo = new Neo(); smith = new Smith(); this.board = new Personages[5, 5]; this.queue = new Queue <Personages>(); putNeoSmith(); relQueue(); putPg(); }