Ejemplo n.º 1
0
        public GameOverStatistics GetGameOverStatistics(GameplayGameState state, IStateOwner pOwner)
        {
            Type[] TetTypes = new Type[] { typeof(Tetrominoes.Tetromino_I),
                                           typeof(Tetrominoes.Tetromino_I),
                                           typeof(Tetrominoes.Tetromino_O),
                                           typeof(Tetrominoes.Tetromino_T),
                                           typeof(Tetrominoes.Tetromino_J),
                                           typeof(Tetrominoes.Tetromino_L),
                                           typeof(Tetrominoes.Tetromino_S),
                                           typeof(Tetrominoes.Tetromino_Z) };


            GameOverStatistic I_Stat = GetTetrominoStatistic(state, typeof(Tetrominoes.Tetromino_I));
            GameOverStatistic O_Stat = GetTetrominoStatistic(state, typeof(Tetrominoes.Tetromino_O));
            GameOverStatistic T_Stat = GetTetrominoStatistic(state, typeof(Tetrominoes.Tetromino_T));
            GameOverStatistic J_Stat = GetTetrominoStatistic(state, typeof(Tetrominoes.Tetromino_J));
            GameOverStatistic L_Stat = GetTetrominoStatistic(state, typeof(Tetrominoes.Tetromino_L));
            GameOverStatistic S_Stat = GetTetrominoStatistic(state, typeof(Tetrominoes.Tetromino_S));
            GameOverStatistic Z_Stat = GetTetrominoStatistic(state, typeof(Tetrominoes.Tetromino_Z));



            GameOverStatistics StatResult = new GameOverStatistics(
                new GameOverStatistic(new GameOverStatisticColumnData("---Line Clears---", Color.White, Color.Black, GameOverStatisticColumnData.HorizontalAlignment.Middle)),

                I_Stat,
                O_Stat,
                T_Stat,
                J_Stat,
                L_Stat,
                S_Stat,
                Z_Stat);

            return(StatResult);
        }
Ejemplo n.º 2
0
        private GameOverStatistic GetTetrominoStatistic(GameplayGameState state, Type TetrominoType)
        {
            GameplayGameState standardgame = state;
            var      useStats = standardgame.GameStats as TetrisStatistics;
            SKBitmap I_Tet    = standardgame.GetTetrominoSKBitmap(TetrominoType);

            SKImage ski = SKImage.FromBitmap(I_Tet);

            GameOverStatistic result = new GameOverStatistic(
                new GameOverStatisticColumnData(ski, GameOverStatisticColumnData.HorizontalAlignment.Left, GameOverStatisticColumnData.VerticalAlignment.Top),
                new GameOverStatisticColumnData(Statistics.GetLineCount(TetrominoType).ToString(), SKColors.White, SKColors.Black, GameOverStatisticColumnData.HorizontalAlignment.Right, GameOverStatisticColumnData.VerticalAlignment.Middle));



            return(result);
        }