Exemplo n.º 1
0
        public static void Initialize(bool resetScoresToDefault = false)
        {
            if (oldHighscoresSolo == null || resetScoresToDefault)
            {
                oldHighscoresSolo = new List<HeroHighscore>(5)
                {
                    new HeroHighscore {id = 999,    name = "JeffZero",  color = Color.CornflowerBlue,   score = 1000000},
                    new HeroHighscore {id = 712,    name = "RPGlord",   color = Color.Chartreuse,       score = 500000},
                    new HeroHighscore {id = 21,     name = "tyder21",   color = Color.Purple,           score = 250000},
                    new HeroHighscore {id = 100,    name = "BIGPUN",    color = Color.Red,              score = 100000},
                    new HeroHighscore {id = 2,      name = "ngirl",     color = Color.Aquamarine,       score = 50000},
                };
            }
            if (oldHighscoresCoop == null || resetScoresToDefault)
            {
                oldHighscoresCoop = new List<HeroHighscoreCoop>(5)
                {
                    new HeroHighscoreCoop {id1 = 1337,     name1 = "Fool",      color1 = Color.Firebrick,   score = 1000000,
                                           id2 = 6969,     name2 = "FAH",       color2 = Color.Indigo},
                    new HeroHighscoreCoop {id1 = 2196,     name1 = "Santa",     color1 = Color.Coral,       score = 500000,
                                           id2 = 0909,     name2 = "Natwaf",    color2 = Color.Crimson},
                    new HeroHighscoreCoop {id1 = 13,       name1 = "XIII",      color1 = Color.DeepPink,    score = 250000,
                                           id2 = 964,      name2 = "LotM",      color2 = Color.SlateBlue},
                    new HeroHighscoreCoop {id1 = 8523,     name1 = "Vlado",     color1 = Color.Gold,        score = 100000,
                                           id2 = 4444,     name2 = "Cishir",    color2 = Color.Purple},
                    new HeroHighscoreCoop {id1 = 1988,     name1 = "Adam",      color1 = Color.Gray,        score = 50000,
                                           id2 = 101,      name2 = "Koala",     color2 = Color.Sienna},
                };
            }
            highscoresSolo = new List<HeroHighscore>(oldHighscoresSolo);
            highscoresCoop = new List<HeroHighscoreCoop>(oldHighscoresCoop);

            currentHighscorePosition = HIGHSCORE_COUNT;
            if (RetroGame.NUM_PLAYERS == 1)
            {
                currentSoloHighscore = new HeroHighscore(RetroGame.getHeroes()[0]);
                for (int i = 0; i < HIGHSCORE_COUNT; i++) //check for existing highscore for these players
                    if (currentSoloHighscore.id == highscoresSolo[i].id && currentSoloHighscore.name == highscoresSolo[i].name && currentSoloHighscore.color == highscoresSolo[i].color)
                    {
                        highscoresSolo[i] = currentSoloHighscore;
                        currentHighscorePosition = i;
                        break;
                    }
            }
            else if (RetroGame.NUM_PLAYERS == 2)
            {
                currentCoopHighscore = new HeroHighscoreCoop(RetroGame.getHeroes()[0], RetroGame.getHeroes()[1]);
                for (int i = 0; i < HIGHSCORE_COUNT; i++) //check for existing highscore for these players
                    if (currentCoopHighscore.id1 == highscoresCoop[i].id1 && currentCoopHighscore.name1 == highscoresCoop[i].name1 && currentCoopHighscore.color1 == highscoresCoop[i].color1 &&
                        currentCoopHighscore.id2 == highscoresCoop[i].id2 && currentCoopHighscore.name2 == highscoresCoop[i].name2 && currentCoopHighscore.color2 == highscoresCoop[i].color2)
                    {
                        highscoresCoop[i] = currentCoopHighscore;
                        currentHighscorePosition = i;
                        break;
                    }
            }
        }
Exemplo n.º 2
0
        public static void Initialize(bool resetScoresToDefault = false)
        {
            if (oldHighscoresSolo == null || resetScoresToDefault)
            {
                oldHighscoresSolo = new List <HeroHighscore>(5)
                {
                    new HeroHighscore {
                        id = 999, name = "JeffZero", color = Color.CornflowerBlue, score = 1000000
                    },
                    new HeroHighscore {
                        id = 712, name = "RPGlord", color = Color.Chartreuse, score = 500000
                    },
                    new HeroHighscore {
                        id = 21, name = "tyder21", color = Color.Purple, score = 250000
                    },
                    new HeroHighscore {
                        id = 100, name = "BIGPUN", color = Color.Red, score = 100000
                    },
                    new HeroHighscore {
                        id = 2, name = "ngirl", color = Color.Aquamarine, score = 50000
                    },
                };
            }
            if (oldHighscoresCoop == null || resetScoresToDefault)
            {
                oldHighscoresCoop = new List <HeroHighscoreCoop>(5)
                {
                    new HeroHighscoreCoop {
                        id1 = 1337, name1 = "Fool", color1 = Color.Firebrick, score = 1000000,
                        id2 = 6969, name2 = "FAH", color2 = Color.Indigo
                    },
                    new HeroHighscoreCoop {
                        id1 = 2196, name1 = "Santa", color1 = Color.Coral, score = 500000,
                        id2 = 0909, name2 = "Natwaf", color2 = Color.Crimson
                    },
                    new HeroHighscoreCoop {
                        id1 = 13, name1 = "XIII", color1 = Color.DeepPink, score = 250000,
                        id2 = 964, name2 = "LotM", color2 = Color.SlateBlue
                    },
                    new HeroHighscoreCoop {
                        id1 = 8523, name1 = "Vlado", color1 = Color.Gold, score = 100000,
                        id2 = 4444, name2 = "Cishir", color2 = Color.Purple
                    },
                    new HeroHighscoreCoop {
                        id1 = 1988, name1 = "Adam", color1 = Color.Gray, score = 50000,
                        id2 = 101, name2 = "Koala", color2 = Color.Sienna
                    },
                };
            }
            highscoresSolo = new List <HeroHighscore>(oldHighscoresSolo);
            highscoresCoop = new List <HeroHighscoreCoop>(oldHighscoresCoop);

            currentHighscorePosition = HIGHSCORE_COUNT;
            if (RetroGame.NUM_PLAYERS == 1)
            {
                currentSoloHighscore = new HeroHighscore(RetroGame.getHeroes()[0]);
                for (int i = 0; i < HIGHSCORE_COUNT; i++) //check for existing highscore for these players
                {
                    if (currentSoloHighscore.id == highscoresSolo[i].id && currentSoloHighscore.name == highscoresSolo[i].name && currentSoloHighscore.color == highscoresSolo[i].color)
                    {
                        highscoresSolo[i]        = currentSoloHighscore;
                        currentHighscorePosition = i;
                        break;
                    }
                }
            }
            else if (RetroGame.NUM_PLAYERS == 2)
            {
                currentCoopHighscore = new HeroHighscoreCoop(RetroGame.getHeroes()[0], RetroGame.getHeroes()[1]);
                for (int i = 0; i < HIGHSCORE_COUNT; i++) //check for existing highscore for these players
                {
                    if (currentCoopHighscore.id1 == highscoresCoop[i].id1 && currentCoopHighscore.name1 == highscoresCoop[i].name1 && currentCoopHighscore.color1 == highscoresCoop[i].color1 &&
                        currentCoopHighscore.id2 == highscoresCoop[i].id2 && currentCoopHighscore.name2 == highscoresCoop[i].name2 && currentCoopHighscore.color2 == highscoresCoop[i].color2)
                    {
                        highscoresCoop[i]        = currentCoopHighscore;
                        currentHighscorePosition = i;
                        break;
                    }
                }
            }
        }