コード例 #1
0
 public ShowHighScoresState(IHighScoreList ScoreList, GameState ReversionState = null, int[] HighlightPositions = null)
 {
     _ScoreList = ScoreList;
     hs         = _ScoreList.GetScores().ToList();
     HighlightedScorePositions = HighlightPositions ?? new int[] { };
     SelectedScorePosition     = HighlightPositions == null || HighlightPositions.Length == 0 ? 1 : HighlightPositions.First() - 1;
     RevertState = ReversionState;
     double xpoint = 1 + TetrisGame.rgen.NextDouble() * 2;
     double ypoint = 1 + TetrisGame.rgen.NextDouble() * 2;
     //var sib = StandardImageBackgroundGDI.GetStandardBackgroundDrawer(new PointF((float)xpoint, (float)ypoint));
 }
コード例 #2
0
        public EnterHighScoreState(GameState pOriginalState, IStateOwner pStateOwner, GameState pReversionState, IHighScoreList ScoreList, Func <string, int, IHighScoreEntry> ScoreFunc, TetrisStatistics SourceStats)
            : base(pStateOwner, 10)
        {
            ScoreListing     = ScoreList;
            ScoreToEntryFunc = ScoreFunc; //function which takes the score and gives back an appropriate IHighScoreEntry implementation.
            GameStatistics   = SourceStats;
            AchievedPosition = ScoreListing.IsEligible(GameStatistics.Score);


            EntryPrompt = (" Congratulations, your score is\n at position " + AchievedPosition + " \n Enter your name.").Split('\n');
        }