Example #1
0
 public bool KeyPressed(Grille grille)
 {
     while (true)
     {
         ConsoleKeyInfo cki;
         cki = Console.ReadKey(true);
         this.userCommand(cki);
     }
 }
Example #2
0
        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();
        }
Example #3
0
 public void goDown(Grille grille)
 {
     grille.suppressionPiece();
     grille.descendrePiece();
     Thread.Sleep(this.delaySpeed);
 }
Example #4
0
 public void goLeft(Grille grille)
 {
     grille.suppressionPiece();
     grille.deplacementPiece(false);
 }
Example #5
0
 public void goRight(Grille grille)
 {
     grille.suppressionPiece();
     grille.deplacementPiece(true);
 }
Example #6
0
 public void addPiece(Grille grille, int id)
 {
     //Ajout Piece
     grille.AjoutPiece(new Piece(id));
 }