public void addPlayTime(PersistData.GT mode, int time) { string name = ""; switch (mode) { case PersistData.GT.Arcade: name = "Arcade"; break; case PersistData.GT.Campaign: name = "Campaign"; break; case PersistData.GT.Challenge: name = "Puzzle"; break; case PersistData.GT.QuickPlay: name = "Quick Play"; break; case PersistData.GT.Training: name = "Training"; break; case PersistData.GT.Versus: name = "Versus"; break; } for (int i = 0; i < timePlayed.Count; i++) { if (timePlayed[i].Key == name) { KeyValuePair <string, int> res = new KeyValuePair <string, int>(timePlayed[i].Key, timePlayed[i].Value + time); timePlayed[i] = res; break; } } }
private void LoadHighScores(PersistData.GT type) { List <KeyValuePair <string, int> > scores = sd.getHighScores(type); List <KeyValuePair <string, int> > times = sd.getBestTimes(type); SetScoreRowAndTimeRowWidths(scores, times); string resScores = GetXmlValue("highscores") + "\n"; string resTimes = GetXmlValue("besttimes") + "\n"; for (int i = 0; i < scores.Count; i++) { string scoreName = (i + 1).ToString() + ". " + scores[i].Key + " "; string timeName = (i + 1).ToString() + ". " + times[i].Key + " "; if (i < 9) { scoreName = " " + scoreName; timeName = " " + timeName; } string scoreText = scores[i].Value.ToString(); string timeText = ConvertSecondsToMinuteSecondFormat(times[i].Value); resScores += GetRowText(scoreName, scoreText, false) + "\n"; resTimes += GetRowText(timeName, timeText, true) + "\n"; } infoPaneFunFact.text = ""; infoPaneTextLeft.text = resScores; infoPaneTextRight.text = resTimes; }
public BlockHandler(PersistData PD, int lv, bool setSeed = false, int seed = 0) { gameType = PD.gameType; balloonNum = (PD.p2Char == PersistData.C.FuckingBalloon)?2:(PD.p1Char == PersistData.C.FuckingBalloon)?1:-1; balloonType = PD.balloonType; isTutorial = PD.isTutorial; if (setSeed) { useSysRandom = true; myBaby = new System.Random(seed); } if (gameType == PersistData.GT.Challenge) { SetupPlayerInts(); SetupTilesForPuzzle(lv); } else if (gameType != PersistData.GT.Training || !isTutorial) { vals = new List <int>(); SetupPlayerInts(); for (int i = 0; i < 50; i++) { vals.Add(Rand()); } } else { if (isTutorial) { SetupPlayerInts(); SetupTilesForPuzzle(0); } } }
public BlockHandler(PersistData PD, int lv) { gameType = PD.gameType; balloonNum = (PD.p2Char == PersistData.C.FuckingBalloon)?2:(PD.p1Char == PersistData.C.FuckingBalloon)?1:-1; balloonType = PD.balloonType; isTutorial = PD.isTutorial; if (gameType == PersistData.GT.Challenge) { SetupPlayerInts(); SetupTilesForPuzzle(lv); } else if (gameType != PersistData.GT.Training || !isTutorial) { vals = new List <int>(); SetupPlayerInts(); for (int i = 0; i < 50; i++) { vals.Add(Random.Range(0, 3)); } } else { if (isTutorial) { SetupPlayerInts(); SetupTilesForPuzzle(0); } } }
public void addToHighScore(string name, int score, PersistData.GT mode) { switch (mode) { case PersistData.GT.Arcade: addToHighScoreDict(ref highScoresArcade, name, score); break; case PersistData.GT.Campaign: addToHighScoreDict(ref highScoresCampaign, name, score); break; case PersistData.GT.QuickPlay: addToHighScoreDict(ref highScoresQuickPlay, name, score); break; } }
public void addToTime(string name, int time, PersistData.GT mode) { switch (mode) { case PersistData.GT.Arcade: addToHighScoreDict(ref shortestTimesArcade, name, time, false); break; case PersistData.GT.Campaign: addToHighScoreDict(ref longestTimesCampaign, name, time); break; case PersistData.GT.QuickPlay: addToHighScoreDict(ref shortestTimesQuickPlay, name, time, false); break; } }
public List <KeyValuePair <string, int> > getBestTimes(PersistData.GT mode) { switch (mode) { case PersistData.GT.Arcade: return(shortestTimesArcade); case PersistData.GT.Campaign: return(longestTimesCampaign); case PersistData.GT.QuickPlay: return(shortestTimesQuickPlay); } return(null); }
public List <KeyValuePair <string, int> > getHighScores(PersistData.GT mode) { switch (mode) { case PersistData.GT.Arcade: return(highScoresArcade); case PersistData.GT.Campaign: return(highScoresCampaign); case PersistData.GT.QuickPlay: return(highScoresQuickPlay); } return(null); }
public void SetToHighScorePanel(PersistData.GT type) { infoPaneTextRight.gameObject.transform.localScale = new Vector3(0.04f, 0.04f); goBack.SetActive(false); switch (type) { case PersistData.GT.QuickPlay: headerText.text = GetXmlValue("quickplay"); break; case PersistData.GT.Arcade: headerText.text = GetXmlValue("arcade"); break; case PersistData.GT.Campaign: headerText.text = GetXmlValue("campaign"); break; } infoPaneFunFact.text = ""; infoPaneTextCenter.text = ""; LoadHighScores(type); }