/// <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(); }
/// <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 }
/// <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 }
/// <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(); }
/// <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; }
/// <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)); }
public AGSSyncableStringSet(string setKeyVal, SyncableMethod syncableMethod) : base(setKeyVal, syncableMethod) { }
/// <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(); }
/// <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) { }
/// <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) { }
/// <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) { }
/// <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(); }
/// <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(); }
/// <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(); }
/// <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) { }
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) { }
/// <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(); }
public AGSSyncableAccumulatingNumber(string numberKeyVal, SyncableMethod syncableMethod) : base(numberKeyVal, syncableMethod) { }
/// <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) { }
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(); }
public AGSLatestStringList(string listKeyVal, SyncableMethod syncableMethod) : base(listKeyVal, syncableMethod) { }
/// <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 }