Exemplo n.º 1
0
    private IEnumerator ConnectLater(Result result, int scoreIndex)
    {
        yield return(new WaitForFixedUpdate());

        var scores = _scoreHandler.GetScores().ToArray();

        Connect(result, scores[scoreIndex]);
    }
Exemplo n.º 2
0
    private SaveInfo RetrieveData()
    {
        var turns  = Results.GetResults();
        var scores = Scores.GetScores().ToArray();

        var counter = 0;

        var si = new SaveInfo {
            TurnInfos = new SaveInfo.TurnInfo[turns.Count], SelectedIndex = -1
        };

        for (var i = 0; i < turns.Count; i++)
        {
            var result = turns[i];

            if (result == Results.Selected)
            {
                si.SelectedIndex = i;
            }

            si.TurnInfos[i].FirstRow        = result.FirstRow().Select(die => die.Number).ToArray();
            si.TurnInfos[i].NumberOfReRolls = result.FirstRow().Select(die => die.AmountOfReRolls()).ToArray();
            si.TurnInfos[i].Seeds           = result.Seeds();

            si.TurnInfos[i].IndexOfConnectedTo = -1;

            if (Results.HasConnection(result))
            {
                var targetScore = Results.GetConnectedTo(result);

                for (var scoreIndex = 0; scoreIndex < scores.Length; scoreIndex++)
                {
                    if (scores[scoreIndex] == targetScore)
                    {
                        si.TurnInfos[i].IndexOfConnectedTo = scoreIndex;
                        break;
                    }
                }

                counter++;
            }
        }

        Debug.Log(counter);

        return(si);
    }
Exemplo n.º 3
0
 private Score GetDropZoneAtPosition(Vector3 position)
 {
     return((from score in _scores.GetScores() let zone = score.DropZoneCollider() where zone.OverlapPoint(position) select score).FirstOrDefault());
 }