public static void WriteNewScore(Player player, int kind) { List_highscore ls = HighScoreGame.ReadHighScore(); if (kind == 1) { ListPlayer p = ls.player_easy; p.player[9] = player; ls.player_easy.sort(); WriteHighScore(new List_highscore(p, ls.player_mid, ls.player_hard)); } else if (kind == 2) { ListPlayer p = ls.player_mid; p.player[9] = player; ls.player_mid.sort(); WriteHighScore(new List_highscore(ls.player_easy, p, ls.player_hard)); } else { ListPlayer p = ls.player_hard; p.player[9] = player; ls.player_hard.sort(); WriteHighScore(new List_highscore(ls.player_easy, ls.player_mid, p)); } }
public Player(Player a) { this.name = a.name; this.king_of_game = a.king_of_game; this.score = a.score; this.Level = a.Level; this.hour = a.hour; this.minute = a.minute; this.second = a.second; }
public static void WriteDefault() { Player[] player_easy = new Player[10]; Player[] player_mid = new Player[10]; Player[] player_hard = new Player[10]; for (int i = 0; i < 10; i++) { player_easy[i] = new Player("UIT", "Medium",i/2+1, i * i * 15, 1, i * 4, i * 3); player_mid[i] = new Player("POKEMON AWARE", "Hard",i/2+1, i * i * 22, 1, i * 6, i * 5); player_hard[i] = new Player("UIT POKEMON Champion", "Hardest",i/2+1, i * i * 23+ 50, 1, i * 5, i * 6); } ListPlayer list_easy = new ListPlayer(player_easy); ListPlayer list_mid = new ListPlayer(player_mid); ListPlayer list_hard = new ListPlayer(player_hard); list_easy.sort(); list_mid.sort(); list_hard.sort(); WriteHighScore(new List_highscore(list_easy, list_mid, list_hard)); }
public void swap(int i, int j) { Player a = new Player(player[i]); Player b = new Player(player[j]); player[i] = new Player(b); player[j] = new Player(a); }
public ListPlayer(Player[] play) { this.player = play; }