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