/// <summary>
    /// Refreshs the list of elements.
    /// </summary>
    void RefreshList()
    {
        if (null == syncableNumberList)
        {
            return;
        }

        // Check if the max size has changed, or the list has become unset.
        maxSize = syncableNumberList.GetMaxSize();
        isSet   = syncableNumberList.IsSet();

        syncableNumberElements      = syncableNumberList.GetValues();
        syncableNumberElementsCache = new AmazonGameCircleExampleWSNumberListElementCache[syncableNumberElements.Length];

        // caching the data in the list locally allows for fast access to this information.
        for (int listIndex = 0; listIndex < syncableNumberElements.Length; listIndex++)
        {
            syncableNumberElementsCache[listIndex] =
                new AmazonGameCircleExampleWSNumberListElementCache(syncableNumberElements[listIndex].AsInt(),
                                                                    syncableNumberElements[listIndex].AsLong(),
                                                                    syncableNumberElements[listIndex].AsDouble(),
                                                                    syncableNumberElements[listIndex].AsString(),
                                                                    syncableNumberElements[listIndex].GetMetadata());
        }
    }
    /// <summary>
    /// Initializes the syncable number list.
    /// </summary>
    /// <param name='dataMap'>
    /// Data map.
    /// </param>
    void InitSyncableNumberList(AGSGameDataMap dataMap)
    {
        // initialize the list based on what type of list it is.
        switch (listType)
        {
        case AvailableListType.HighNumber:
            syncableNumberList = dataMap.GetHighNumberList(ListName());
            break;

        case AvailableListType.LatestNumber:
            syncableNumberList = dataMap.GetLatestNumberList(ListName());
            break;

        case AvailableListType.LowNumber:
            syncableNumberList = dataMap.GetLowNumberList(ListName());
            break;
        }
        // cache the size and if the list has been set.
        maxSize = syncableNumberList.GetMaxSize();
        isSet   = syncableNumberList.IsSet();
    }
コード例 #3
0
 /// <summary>
 /// Initializes the syncable number list.
 /// </summary>
 /// <param name='dataMap'>
 /// Data map.
 /// </param>
 void InitSyncableNumberList(AGSGameDataMap dataMap)
 {
     // initialize the list based on what type of list it is.
     switch(listType) {
     case AvailableListType.HighNumber:
         syncableNumberList = dataMap.GetHighNumberList(ListName());
         break;
     case AvailableListType.LatestNumber:
         syncableNumberList = dataMap.GetLatestNumberList(ListName());
         break;
     case AvailableListType.LowNumber:
         syncableNumberList = dataMap.GetLowNumberList(ListName());
         break;
     }
     // cache the size and if the list has been set.
     maxSize = syncableNumberList.GetMaxSize();
     isSet = syncableNumberList.IsSet();
 }