Example #1
0
    public override void StartEditingTeam(int InTeamIndex)
    {
        if (Global.AllData == null || CurPool == EPool.None || (int)CurPool >= Global.AllData.AllDivisions[(int)CurDivision].Rounds[(int)CurRound].Pools.Count ||
            InTeamIndex < 0 || InTeamIndex >= Global.AllData.AllDivisions[(int)CurDivision].Rounds[(int)CurRound].Pools[(int)CurPool].Teams.Count)
        {
            return;
        }

        RoutineScoreData SData = Global.AllData.AllDivisions[(int)CurDivision].Rounds[(int)CurRound].Pools[(int)CurPool].Teams[InTeamIndex].Data.RoutineScores;

        if (SData != null && SData.DiffResults != null)
        {
            CurData = null;

            base.StartEditingTeam(InTeamIndex);

            foreach (ExData ed in SData.ExResults)
            {
                if (ed.JudgeNameId == GetJudgeNameId())
                {
                    CurData = ed;
                    break;
                }
            }

            if (CurData == null)
            {
                CurData = new ExData(CurDivision, CurRound, CurPool, InTeamIndex);
            }
        }

        UpdatePoints();
    }
Example #2
0
    public override void SendResultsToHeadJudger(int InDiv, int InRound, int InPool, int InTeam)
    {
        base.SendResultsToHeadJudger(InDiv, InRound, InPool, InTeam);

        Debug.Log(" SendResultsToHeadJudger " + InDiv + " " + InRound + " " + InPool + " " + InTeam);

        RoutineScoreData SData = Global.AllData.AllDivisions[InDiv].Rounds[InRound].Pools[InPool].Teams[InTeam].Data.RoutineScores;

        CurData.Division    = (EDivision)InDiv;
        CurData.Round       = (ERound)InRound;
        CurData.Pool        = (EPool)InPool;
        CurData.Team        = InTeam;
        CurData.JudgeNameId = GetJudgeNameId();
        SData.SetExResults(CurData);

        if (Networking.IsConnectedToServer)
        {
            Debug.Log(" send ex data to server " + CurData.Point1Count);

            Global.NetObj.ClientSendFinishJudgingEx(CurData.SerializeToString());
        }
        else
        {
            CachedData = new ExData(CurData);
            Networking.bNeedSendCachedResults = true;
        }
    }
Example #3
0
    public void InitButtonTeamsText(int InDiv, int InRound, int InPool, int InJudgeCategoryIndex, ECategoryView InCategoryView)
    {
        CanvasGO.SetActive(true);

        if (InDiv >= 0 && InDiv < Global.AllData.AllDivisions.Length &&
            InRound >= 0 && InRound < Global.AllData.AllDivisions[InDiv].Rounds.Length &&
            InPool >= 0 && InPool < Global.AllData.AllDivisions[InDiv].Rounds[InRound].Pools.Count)
        {
            int buttonIndex = 0;
            foreach (GameObject go in TeamButtons)
            {
                Button button = go.GetComponent <Button>();
                button.onClick.RemoveAllListeners();

                if (buttonIndex < Global.AllData.AllDivisions[InDiv].Rounds[InRound].Pools[InPool].Teams.Count)
                {
                    go.SetActive(true);
                    int localButtonIndex = buttonIndex;
                    button.onClick.AddListener(() => { TeamButtonClicked(localButtonIndex); });

                    RoutineScoreData SData       = Global.AllData.AllDivisions[InDiv].Rounds[InRound].Pools[InPool].Teams[buttonIndex].Data.RoutineScores;
                    string           PlayerNames = Global.AllData.AllDivisions[InDiv].Rounds[InRound].Pools[InPool].Teams[buttonIndex].Data.PlayerNames;
                    if (SData != null)
                    {
                        foreach (Text buttonText in go.GetComponentsInChildren <Text>())
                        {
                            string buttonString = PlayerNames;
                            if (SData.ContainsJudgeScores())
                            {
                                buttonString += ": " + SData.GetResultsString(InJudgeCategoryIndex, InCategoryView, false);
                            }
                            else
                            {
                                buttonString += ": No Data";
                            }

                            buttonText.text = buttonString;
                        }
                    }
                }
                else
                {
                    go.SetActive(false);
                }

                ++buttonIndex;
            }
        }
    }
Example #4
0
    public override void StartEditingTeam(int InTeamIndex)
    {
        if (Global.AllData == null || CurPool == EPool.None || (int)CurPool >= Global.AllData.AllDivisions[(int)CurDivision].Rounds[(int)CurRound].Pools.Count ||
            InTeamIndex < 0 || InTeamIndex >= Global.AllData.AllDivisions[(int)CurDivision].Rounds[(int)CurRound].Pools[(int)CurPool].Teams.Count)
        {
            return;
        }

        RoutineScoreData SData = Global.AllData.AllDivisions[(int)CurDivision].Rounds[(int)CurRound].Pools[(int)CurPool].Teams[InTeamIndex].Data.RoutineScores;

        if (SData != null && SData.DiffResults != null)
        {
            CurData = null;

            base.StartEditingTeam(InTeamIndex);

            foreach (AIData aid in SData.AIResults)
            {
                if (aid.JudgeNameId == GetJudgeNameId())
                {
                    CurData = aid;
                    break;
                }
            }

            if (CurData == null)
            {
                CurData = new AIData(CurDivision, CurRound, CurPool, InTeamIndex);
            }

            VarietyNS.NumberValue  = CurData.Variety;
            TeamworkNS.NumberValue = CurData.Teamwork;
            MusicNS.NumberValue    = CurData.Music;
            FlowNS.NumberValue     = CurData.Flow;
            FormNS.NumberValue     = CurData.Form;
            GeneralNS.NumberValue  = CurData.General;
        }
    }
    public override void SendResultsToHeadJudger(int InDiv, int InRound, int InPool, int InTeam)
    {
        base.SendResultsToHeadJudger(InDiv, InRound, InPool, InTeam);

        RoutineScoreData SData = Global.AllData.AllDivisions[InDiv].Rounds[InRound].Pools[(int)CurPool].Teams[InTeam].Data.RoutineScores;

        CurData.Division    = (EDivision)InDiv;
        CurData.Round       = (ERound)InRound;
        CurData.Pool        = (EPool)InPool;
        CurData.Team        = InTeam;
        CurData.JudgeNameId = GetJudgeNameId();
        SData.SetDiffResults(CurData);

        if (Networking.IsConnectedToServer)
        {
            Global.NetObj.ClientSendFinishJudgingDiff(CurData.SerializeToString());
        }
        else
        {
            CachedData = new DiffData(CurData);
            Networking.bNeedSendCachedResults = true;
        }
    }
    public override void StartEditingTeam(int InTeamIndex)
    {
        if (Global.AllData == null || CurPool == EPool.None || (int)CurPool >= Global.AllData.AllDivisions[(int)CurDivision].Rounds[(int)CurRound].Pools.Count ||
            InTeamIndex < 0 || InTeamIndex >= Global.AllData.AllDivisions[(int)CurDivision].Rounds[(int)CurRound].Pools[(int)CurPool].Teams.Count)
        {
            return;
        }

        RoutineScoreData SData = Global.AllData.AllDivisions[(int)CurDivision].Rounds[(int)CurRound].Pools[(int)CurPool].Teams[InTeamIndex].Data.RoutineScores;

        if (SData != null && SData.DiffResults != null)
        {
            CurData = null;

            base.StartEditingTeam(InTeamIndex);

            foreach (DiffData dd in SData.DiffResults)
            {
                if (dd.JudgeNameId == GetJudgeNameId())
                {
                    CurData = dd;
                    break;
                }
            }

            if (CurData == null)
            {
                CurData = new DiffData(GetNumScoreBlocks(), CurDivision, CurRound, CurPool, InTeamIndex);
            }

            for (int i = 0; i < GetNumScoreBlocks(); ++i)
            {
                NSArray[i].NumberValue = CurData.DiffScores[i];
                ConsecScores[i]        = CurData.ConsecScores[i];
            }
        }
    }