예제 #1
0
    // Callbacks

    void achievementAllDefinitionCallback(Pvr_Message <Pvr_AchievementDefinitionList> msg)
    {
        if (!msg.IsError)
        {
            printOutputLine("Received achievement definitions success");
            Pvr_AchievementDefinitionList definitionList = msg.GetAchievementDefinitions();
            if (definitionList.HasNextPage)
            {
                Achievements.GetNextAchievementDefinitionListPage(definitionList).OnComplete(achievementAllDefinitionCallback);
            }

            foreach (var definition in definitionList)
            {
                printOutputLine("Bitfield Name: " + definition.Name.ToString());
                switch (definition.Type)
                {
                case AchievementType.Simple:
                    printOutputLine("Achievement Type: Simple");
                    break;

                case AchievementType.Bitfield:
                    printOutputLine("Achievement Type: Bitfield");
                    printOutputLine("Bitfield Length: " + definition.BitfieldLength.ToString());
                    printOutputLine("Target: " + definition.Target.ToString());
                    break;

                case AchievementType.Count:
                    printOutputLine("Achievement Type: Count");
                    printOutputLine("Target: " + definition.Target.ToString());
                    break;

                case AchievementType.Unknown:
                default:
                    printOutputLine("Achievement Type: Unknown");
                    break;
                }
                printOutputLine("Bitfield Title: " + definition.Title.ToString());
                printOutputLine("Bitfield Description: " + definition.Description.ToString());
                printOutputLine("Bitfield UnlockedDescription: " + definition.UnlockedDescription.ToString());
                printOutputLine("Bitfield UnlockedIcon: " + definition.UnlockedIcon.ToString());
                printOutputLine("Bitfield LockedIcon: " + definition.LockedIcon.ToString());
                printOutputLine("Bitfield IsSecrect: " + definition.IsSecrect.ToString());
            }
        }
        else
        {
            printOutputLine("Received achievement definitions error");
            Error error = msg.GetError();
            printOutputLine("Error: Message:" + error.Message + " Code: " + error.Code + " HttpCode: " + error.HttpCode);
        }
    }
예제 #2
0
    void achievementDefinitionCallback(Pvr_Message <Pvr_AchievementDefinitionList> msg)
    {
        if (!msg.IsError)
        {
            printOutputLine("Received achievement definitions success");
            Pvr_AchievementDefinitionList definitionList = msg.GetAchievementDefinitions();

            foreach (var definition in definitionList)
            {
                switch (definition.Type)
                {
                case AchievementType.Simple:
                    printOutputLine("Achievement Type: Simple");
                    break;

                case AchievementType.Bitfield:
                    printOutputLine("Achievement Type: Bitfield");
                    printOutputLine("Bitfield Length: " + definition.BitfieldLength.ToString());
                    printOutputLine("Target: " + definition.Target.ToString());
                    break;

                case AchievementType.Count:
                    printOutputLine("Achievement Type: Count");
                    printOutputLine("Target: " + definition.Target.ToString());
                    break;

                case AchievementType.Unknown:
                default:
                    printOutputLine("Achievement Type: Unknown");
                    break;
                }
            }
        }
        else
        {
            printOutputLine("Received achievement definitions error");
            Error error = msg.GetError();
            printOutputLine("Error: Message:" + error.Message + " Code: " + error.Code + " HttpCode: " + error.HttpCode);
        }
    }