Example #1
0
        /// <summary>
        /// Sends a 'garbage line' to the other player
        /// </summary>
        /// <param name="amount">The amound of garbage line to be added to the other player</param>
        /// <param name="sender">The player that sends the garbage lines</param>
        public void SendGarbageLines(int amount, TetrisGrid sender)
        {
            var receiver = _players.FirstOrDefault(x => x != sender);

            if (receiver != null)
            {
                receiver.garbageLines += amount;
            }
        }
Example #2
0
        private TetrisGrid parentGrid;                                              //Copy of the current grid


        protected Tetronimo(TetrisGrid parentGrid) //getting access to the TetrisGrid
        {
            this.parentGrid = parentGrid;
        }