Ejemplo n.º 1
0
    /// <summary>
    /// Gets the AGS syncable.
    /// </summary>
    /// <returns>
    /// The AGS syncable.
    /// </returns>
    /// <param name='method'>
    /// Method.
    /// </param>
    /// <param name='key'>
    /// Key.
    /// </param>
    /// <typeparam name='T'>
    /// The 1st type parameter.
    /// </typeparam>
    protected T GetAGSSyncable <T>(SyncableMethod method, string key)
    {
#if UNITY_ANDROID
        AndroidJavaObject jo;
        if (key != null)
        {
            jo = javaObject.Call <AndroidJavaObject>(method.ToString(), key);
        }
        else
        {
            jo = javaObject.Call <AndroidJavaObject>(method.ToString());
        }
        if (jo != null)
        {
            return((T)Activator.CreateInstance(typeof(T), new object[] { jo }));
        }
        //return null or 0 as appropriate to the data type returned
        return(default(T));
#elif UNITY_IOS
        return((T)Activator.CreateInstance(typeof(T), key, method));
#else
        //return null or 0 as appropriate to the data type returned
        return(default(T));
#endif
    }
    /// <summary>
    /// Syncables the method to list behavior.
    /// </summary>
    /// <returns>
    /// The method to list behavior.
    /// </returns>
    /// <param name='syncableMethod'>
    /// Syncable method.
    /// </param>
    SyncableListBehavior SyncableMethodToListBehavior(SyncableMethod syncableMethod)
    {
        switch (syncableMethod)
        {
        case SyncableMethod.getHighestNumber:
        case SyncableMethod.getHighNumberList:
            return(SyncableListBehavior.HighNumber);

        case SyncableMethod.getLatestNumber:
        case SyncableMethod.getLatestNumberList:
            return(SyncableListBehavior.LatestNumber);

        case SyncableMethod.getLowestNumber:
        case SyncableMethod.getLowNumberList:
            return(SyncableListBehavior.LowNumber);

        case SyncableMethod.getLatestString:
        case SyncableMethod.getLatestStringList:
            return(SyncableListBehavior.LatestString);

        default:
            AGSClient.LogGameCircleError(string.Format("Unhandled AGSSyncableNumberList type {0}", syncableMethod.ToString()));
            // still need to return something if error logging is set to a level less than exception.
            return(SyncableListBehavior.HighNumber);
        }
    }
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableNumberElement"/> class.
 /// </summary>
 /// <param name='listOwningThisNumber'>
 /// List owner.
 /// </param>
 /// <param name='indexInList'>
 /// List index.
 /// </param>
 /// <param name='numberKeyVal'>
 /// Number key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableNumberElement(AGSSyncableNumberList listOwningThisNumber,
                                 int indexInList,
                                 SyncableMethod syncableMethod) : base(listOwningThisNumber, indexInList, syncableMethod)
 {
     numberBehavior = SyncableBehaviorFromSyncableMethod(syncableMethod);
     InitializeNativeFunctionCalls();
 }
Ejemplo n.º 4
0
    /// <summary>
    /// Initializes a new instance of the <see cref="AGSSyncableElement"/> class.
    /// </summary>
    /// <param name='elementKeyVal'>
    /// Element key value.
    /// </param>
    /// <param name='syncableMethod'>
    /// Syncable method.
    /// </param>
    public AGSSyncableElement(string elementKeyVal, SyncableMethod syncableMethod) : base(elementKeyVal, syncableMethod)
    {
        listIndex = null;
        listOwner = null;
        InitializeNativeFunctionCalls();
#if !UNITY_EDITOR
        this.setOwner = null;
#endif
    }
Ejemplo n.º 5
0
    /// <summary>
    /// Initializes a new instance of the <see cref="AGSSyncableElement"/> class.
    /// </summary>
    /// <param name='elementKeyVal'>
    /// Element key value.
    /// </param>
    /// <param name='syncableMethod'>
    /// Syncable method.
    /// </param>
    public AGSSyncableElement(string elementKeyVal, SyncableMethod syncableMethod) : base(elementKeyVal, syncableMethod) {
        listIndex = null;
        listOwner = null;
        InitializeNativeFunctionCalls();
#if !UNITY_EDITOR
        this.setOwner = null;
#endif
        
    }    
Ejemplo n.º 6
0
    /// <summary>
    /// Initializes a new instance of the <see cref="AGSSyncableElement"/> class.
    /// </summary>
    /// <param name='listOwningThisNumber'>
    /// List owning this number.
    /// </param>
    /// <param name='indexInList'>
    /// Index in list.
    /// </param>
    /// <param name='syncableMethod'>
    /// Syncable method.
    /// </param>
    public AGSSyncableElement(AGSSyncableList listOwningThisNumber,
                              int indexInList,
                              SyncableMethod syncableMethod) : base(null, syncableMethod)
    {
        listIndex = indexInList;
        listOwner = listOwningThisNumber;
        InitializeNativeFunctionCalls();
#if !UNITY_EDITOR
        this.setOwner = null;
#endif
    }
    /// <summary>
    /// Initializes the behavior of the syncable number element for iOS.
    /// </summary>
    /// <param name='syncableMethod'>
    /// Syncable method.
    /// </param>
    SyncableNumberBehavior SyncableBehaviorFromSyncableMethod(SyncableMethod syncableMethod)
    {
        switch (syncableMethod)
        {
        case SyncableMethod.getHighestNumber:
        case SyncableMethod.getHighNumberList:
            return(SyncableNumberBehavior.Highest);

        case SyncableMethod.getLatestNumber:
        case SyncableMethod.getLatestNumberList:
            return(SyncableNumberBehavior.Latest);

        case SyncableMethod.getLowestNumber:
        case SyncableMethod.getLowNumberList:
            return(SyncableNumberBehavior.Lowest);

        default:
            AGSClient.LogGameCircleError(string.Format("Unhandled SyncableNumberElement type {0}", syncableMethod.ToString()));
            return(SyncableNumberBehavior.Latest);
        }
    }
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableStringElement"/> class.
 /// </summary>
 /// <param name='keyVal'>
 /// Key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableStringElement(string keyVal, SyncableMethod syncableMethod) : base(keyVal, syncableMethod)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableNumberElement"/> class.
 /// </summary>
 /// <param name='elementKeyVal'>
 /// Element key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableNumberElement(string elementKeyVal, SyncableMethod syncableMethod) : base(elementKeyVal, syncableMethod)
 {
     numberBehavior = SyncableBehaviorFromSyncableMethod(syncableMethod);
     InitializeNativeFunctionCalls();
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncable"/> class.
 /// </summary>
 /// <param name='keyVal'>
 /// Key value of this Syncable object.
 /// </param>
 /// <param name='syncableMethod'>
 /// Method to be used to sync objects.
 /// </param>/
 public AGSSyncable(string keyVal, SyncableMethod syncableMethod)
 {
     key    = keyVal;
     method = syncableMethod;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Gets the AGS syncable.
 /// </summary>
 /// <returns>
 /// The AGS syncable.
 /// </returns>
 /// <param name='method'>
 /// Method.
 /// </param>
 /// <typeparam name='T'>
 /// The 1st type parameter.
 /// </typeparam>
 protected T GetAGSSyncable <T>(SyncableMethod method)
 {
     return(GetAGSSyncable <T>(method, null));
 }
Ejemplo n.º 12
0
 public AGSSyncableStringSet(string setKeyVal, SyncableMethod syncableMethod)
     : base(setKeyVal, syncableMethod)
 {
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableNumber"/> class.
 /// </summary>
 /// <param name='numberKeyVal'>
 /// Number key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableNumber(string numberKeyVal, SyncableMethod syncableMethod) : base(numberKeyVal, syncableMethod)
 {
     InitializeNativeFunctionCalls();
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableStringElement"/> class.
 /// </summary>
 /// <param name='listOwner'>
 /// List owner.
 /// </param>
 /// <param name='listIndex'>
 /// List index.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableStringElement(AGSSyncableStringList listOwner, 
                         int listIndex, 
                         SyncableMethod syncableMethod)
     : base(listOwner, listIndex, syncableMethod)
 {
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableStringElement"/> class.
 /// </summary>
 /// <param name='setOwner'>
 /// Set owner.
 /// </param>
 /// <param name='keyVal'>
 /// Key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableStringElement(AGSSyncableStringSet setOwner, 
                         string keyVal,
                         SyncableMethod syncableMethod)
     : base(setOwner, keyVal, syncableMethod)
 {
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Syncables the method to list behavior.
 /// </summary>
 /// <returns>
 /// The method to list behavior.
 /// </returns>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 SyncableListBehavior SyncableMethodToListBehavior(SyncableMethod syncableMethod) {
     switch(syncableMethod) {
     case SyncableMethod.getHighestNumber:
     case SyncableMethod.getHighNumberList:            
         return SyncableListBehavior.HighNumber;
     case SyncableMethod.getLatestNumber:
     case SyncableMethod.getLatestNumberList:
         return SyncableListBehavior.LatestNumber;
     case SyncableMethod.getLowestNumber:
     case SyncableMethod.getLowNumberList:
         return SyncableListBehavior.LowNumber;
     case SyncableMethod.getLatestString:
     case SyncableMethod.getLatestStringList:
         return SyncableListBehavior.LatestString;
     default:
         AGSClient.LogGameCircleError(string.Format("Unhandled AGSSyncableNumberList type {0}",syncableMethod.ToString()));
         // still need to return something if error logging is set to a level less than exception.
         return SyncableListBehavior.HighNumber;
     }        
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableDeveloperString"/> class.
 /// </summary>
 /// <param name='keyVal'>
 /// Key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableDeveloperString(string keyVal, SyncableMethod syncableMethod) : base(keyVal, syncableMethod)
 {
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableNumber"/> class.
 /// </summary>
 /// <param name='listOwner'>
 /// List owner.
 /// </param>
 /// <param name='listIndex'>
 /// List index.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableNumber(AGSSyncableNumberList listOwner, 
                         int listIndex, 
                         SyncableMethod syncableMethod) : base(listOwner, listIndex, syncableMethod) {
     InitializeNativeFunctionCalls();
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableNumber"/> class.
 /// </summary>
 /// <param name='numberKeyVal'>
 /// Number key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableNumber(string numberKeyVal, SyncableMethod syncableMethod) : base(numberKeyVal, syncableMethod) {
     InitializeNativeFunctionCalls();
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableNumber"/> class.
 /// </summary>
 /// <param name='listOwner'>
 /// List owner.
 /// </param>
 /// <param name='listIndex'>
 /// List index.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableNumber(AGSSyncableNumberList listOwner,
                          int listIndex,
                          SyncableMethod syncableMethod) : base(listOwner, listIndex, syncableMethod)
 {
     InitializeNativeFunctionCalls();
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableList"/> class.
 /// </summary>
 /// <param name='listKeyVal'>
 /// List key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableList(string listKeyVal, SyncableMethod syncableMethod) : base(listKeyVal, syncableMethod) {
     listBehavior = SyncableMethodToListBehavior(syncableMethod);
     InitializeNativeFunctionCalls();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableStringElement"/> class.
 /// </summary>
 /// <param name='listOwner'>
 /// List owner.
 /// </param>
 /// <param name='listIndex'>
 /// List index.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableStringElement(AGSSyncableStringList listOwner,
                                 int listIndex,
                                 SyncableMethod syncableMethod) : base(listOwner, listIndex, syncableMethod)
 {
 }
Ejemplo n.º 23
0
 public AGSLatestStringList(string listKeyVal, SyncableMethod syncableMethod) : base(listKeyVal, syncableMethod)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableStringElement"/> class.
 /// </summary>
 /// <param name='setOwner'>
 /// Set owner.
 /// </param>
 /// <param name='keyVal'>
 /// Key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableStringElement(AGSSyncableStringSet setOwner,
                                 string keyVal,
                                 SyncableMethod syncableMethod) : base(setOwner, keyVal, syncableMethod)
 {
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableStringElement"/> class.
 /// </summary>
 /// <param name='keyVal'>
 /// Key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableStringElement(string keyVal, SyncableMethod syncableMethod)
     : base(keyVal, syncableMethod)
 {
 }
 public AGSSyncableStringSet(string setKeyVal, SyncableMethod syncableMethod) : base(setKeyVal, syncableMethod)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableList"/> class.
 /// </summary>
 /// <param name='listKeyVal'>
 /// List key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableList(string listKeyVal, SyncableMethod syncableMethod) : base(listKeyVal, syncableMethod)
 {
     listBehavior = SyncableMethodToListBehavior(syncableMethod);
     InitializeNativeFunctionCalls();
 }
Ejemplo n.º 28
0
 public AGSSyncableAccumulatingNumber(string numberKeyVal, SyncableMethod syncableMethod) : base(numberKeyVal, syncableMethod)
 {
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AGSSyncableDeveloperString"/> class.
 /// </summary>
 /// <param name='keyVal'>
 /// Key value.
 /// </param>
 /// <param name='syncableMethod'>
 /// Syncable method.
 /// </param>
 public AGSSyncableDeveloperString(string keyVal, SyncableMethod syncableMethod)
     : base(keyVal, syncableMethod)
 {
 }
Ejemplo n.º 30
0
 public AGSSyncableNumberList(string listKeyVal, SyncableMethod syncableMethod) : base(listKeyVal, syncableMethod) {
     
     InitializeNativeFunctionCalls();
 }
 public AGSSyncableAccumulatingNumber(string numberKeyVal, SyncableMethod syncableMethod)
     : base(numberKeyVal, syncableMethod)
 {
 }
 public AGSSyncableNumberList(string listKeyVal, SyncableMethod syncableMethod) : base(listKeyVal, syncableMethod)
 {
     InitializeNativeFunctionCalls();
 }
Ejemplo n.º 33
0
 public AGSLatestStringList(string listKeyVal, SyncableMethod syncableMethod)
     : base(listKeyVal, syncableMethod)
 {
 }
Ejemplo n.º 34
0
    /// <summary>
    /// Initializes a new instance of the <see cref="AGSSyncableElement"/> class.
    /// </summary>
    /// <param name='listOwningThisNumber'>
    /// List owning this number.
    /// </param>
    /// <param name='indexInList'>
    /// Index in list.
    /// </param>
    /// <param name='syncableMethod'>
    /// Syncable method.
    /// </param>
    public AGSSyncableElement(AGSSyncableList listOwningThisNumber, 
                            int indexInList, 
                            SyncableMethod syncableMethod) : base(null, syncableMethod) {
        
        listIndex = indexInList;
        listOwner = listOwningThisNumber;
        InitializeNativeFunctionCalls();
#if !UNITY_EDITOR
        this.setOwner = null;
#endif
    }