Esempio n. 1
0
    public void setPlatform(TypePlatformKnownValues new_value)
    {
        TypePlatform new_full_value = new TypePlatform();

        Debug.Assert(new_value != TypePlatformKnownValues.Platform__none);
        new_full_value.in_known_list = true;
        new_full_value.list_value    = new_value;
        setPlatform(new_full_value);
    }
Esempio n. 2
0
    /// <summary>
    /// Check type platform, we need add to same data pool if same type plaform
    /// </summary>
    DataPool?GetDataPool(TypePlatform typePlaform)
    {
        foreach (DataPool data in poolList)
        {
            if (data.typePlatform == typePlaform)
            {
                return(data);
            }
        }

        return(null);
    }
Esempio n. 3
0
    public string  getPlatformAsString()
    {
        TypePlatform result = getPlatform();

        if (result.in_known_list)
        {
            return(stringFromPlatform(result.list_value));
        }
        else
        {
            return(result.string_value);
        }
    }
Esempio n. 4
0
            protected override void handle_result(string result)
            {
                TypePlatformKnownValues known     = stringToPlatform(result);
                TypePlatform            new_value = new TypePlatform();

                if (known == TypePlatformKnownValues.Platform__none)
                {
                    new_value.in_known_list = false;
                    new_value.string_value  = result;
                }
                else
                {
                    new_value.in_known_list = true;
                    new_value.list_value    = known;
                }
                handle_result(new_value);
            }
Esempio n. 5
0
    public void setPlatform(string chars)
    {
        TypePlatformKnownValues known     = stringToPlatform(chars);
        TypePlatform            new_value = new TypePlatform();

        if (known == TypePlatformKnownValues.Platform__none)
        {
            new_value.in_known_list = false;
            new_value.string_value  = chars;
        }
        else
        {
            new_value.in_known_list = true;
            new_value.list_value    = known;
        }
        setPlatform(new_value);
    }
Esempio n. 6
0
    private void  fromJSONPlatform(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        JSONStringValue json_string = json_value.string_value();

        if (json_string == null)
        {
            throw new Exception("The value for field Platform of UserAppParsingItemJSON is not a string.");
        }
        TypePlatform the_open_enum = new TypePlatform();

        switch (json_string.getData()[0])
        {
        case 'A':
            if ((String.Compare(json_string.getData(), 1, "ndroid", 0, 6, false) == 0) && (json_string.getData().Length == 7))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypePlatformKnownValues.Platform_Android;
                goto open_enum_is_done;
            }
            break;

        case 'i':
            if ((String.Compare(json_string.getData(), 1, "OS", 0, 2, false) == 0) && (json_string.getData().Length == 3))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypePlatformKnownValues.Platform_iOS;
                goto open_enum_is_done;
            }
            break;

        default:
            break;
        }
        the_open_enum.in_known_list = false;
        the_open_enum.string_value  = json_string.getData();
        open_enum_is_done :;
        setPlatform(the_open_enum);
    }
Esempio n. 7
0
    // Return object with type Platform
    public GameObject GetPoolObj(TypePlatform typePlatform)
    {
        foreach (DataPool data in poolList)
        {
            if (typePlatform == data.typePlatform)
            {
                if (data.objPools.Count > countEachObj)
                {
                    #region Random In List Object pool same type
                    int rand = (int)(UnityEngine.Random.Range(0, data.objPools.Count)) / countEachObj;

                    for (int i = rand * countEachObj; i < rand * countEachObj + countEachObj; i++)
                    {
                        if (!data.objPools [i].activeSelf)
                        {
                            data.objPools [i].SetActive(true);
                            return(data.objPools [i]);
                        }
                    }
                    #endregion
                }
                else
                {
                    foreach (GameObject obj in data.objPools)
                    {
                        if (!obj.activeSelf)
                        {
                            obj.SetActive(true);
                            return(obj);
                        }
                    }
                }
            }
        }

        Debug.Log("Type: " + typePlatform + "out range!");

        return(null);
    }
Esempio n. 8
0
 protected override void handle_result(TypePlatform result)
 {
     top.value.Add(result);
 }
Esempio n. 9
0
            protected override void handle_result(TypePlatform result)
            {
//@@@        Debug.Assert(!have_value);
                have_value = true;
                value      = result;
            }
Esempio n. 10
0
 protected abstract void handle_result(TypePlatform result);
Esempio n. 11
0
 public void setPlatform(TypePlatform new_value)
 {
     flagHasPlatform = true;
     storePlatform   = new_value;
 }
Esempio n. 12
0
 public DataPool(TypePlatform typePlatform, List <GameObject> objPools)
 {
     this.typePlatform = typePlatform;
     this.objPools     = objPools;
 }