// top text to look like: Computer Counting Run of 3 // bottom text like 3 of 9 points public async Task PopulateGrid(List <CardView> cards, ScoreInstance score, PlayerType player, ScoreType scoreType, int index, int total, int actualScore, string gameScore) { _cards = cards; _score = score; _player = player; _scoreType = scoreType; _index = index; _total = total; _actualScore = actualScore; _gameScore = gameScore; await PopulateGrid(); MainPage.Current.StatsView.Stats.Stat(score.ScoreType).UpdateStatistic(player, actualScore); }
void Start() { if (instance == null) { instance = this; } else { Destroy(gameObject); } timeElapsed = 0f; score = 0; }
public async Task PopulateGrid(string savedState) { char[] sep = new char[] { '|' }; string[] tokens = savedState.Split(sep, StringSplitOptions.RemoveEmptyEntries); if (tokens.Count() < 8) { throw new InvalidDataException(); } _player = (PlayerType)Enum.Parse(typeof(PlayerType), tokens[0]); _scoreType = (ScoreType)Enum.Parse(typeof(ScoreType), tokens[1]); _score = new ScoreInstance(tokens[2]); _index = Convert.ToInt32(tokens[3]); _total = Convert.ToInt32(tokens[4]); _actualScore = Convert.ToInt32(tokens[5]); _gameScore = tokens[6]; _cards = StaticHelpers.DeserializeToList(tokens[7], MainPage.Current.Deck); await PopulateGrid(); }