public bool KeyPressed(Grille grille) { while (true) { ConsoleKeyInfo cki; cki = Console.ReadKey(true); this.userCommand(cki); } }
public GameManager(String ipAddress, int portNum) { _client = new TcpClient(); _client.Connect(ipAddress, portNum); StreamReader reader = new StreamReader(_client.GetStream(), Encoding.ASCII); string [] str = splitInfos(reader); this.column = Convert.ToInt32(str[0]); this.maxNumberOfLines = Convert.ToInt32(str[1]); this.delaySpeed = Convert.ToInt32(str[2]); //init grille this.grille = new Grille(maxNumberOfLines, column); this.refresh = 25; this.finishGame = false; this.finishWithPiece = false; this.threadDisplay = new Thread(() => display(this)); // this.threadDelete = new Thread(() => deleteLine()); this.threadKey = new Thread(() => KeyPressed(grille)); this.setGameManager(); }
public void goDown(Grille grille) { grille.suppressionPiece(); grille.descendrePiece(); Thread.Sleep(this.delaySpeed); }
public void goLeft(Grille grille) { grille.suppressionPiece(); grille.deplacementPiece(false); }
public void goRight(Grille grille) { grille.suppressionPiece(); grille.deplacementPiece(true); }
public void addPiece(Grille grille, int id) { //Ajout Piece grille.AjoutPiece(new Piece(id)); }