示例#1
0
        /// <summary>
        /// Gets a Resource by its <paramref name="id"/>
        /// </summary>
        /// <typeparam name="T">Type of the resource to be recovered</typeparam>
        /// <param name="id">Unique id for the resource to be recovered</param>
        /// <param name="cancellationToken"></param>
        /// <returns>Recovered resource of type <c>T</c></returns>
        public async Task <T> GetAsync <T>(string id, CancellationToken cancellationToken = default(CancellationToken)) where T : Document
        {
            var resourceExtension = new ResourceExtension(_sender);
            var resource          = await resourceExtension.GetAsync <T>(id, cancellationToken).ConfigureAwait(false);

            return(resource);
        }
示例#2
0
        void GetUserData()
        {
            _user_data = MainWindow._user_data_manager.Data;

            foreach (KeyValuePair <EQUIP_TYPE_ENUM, EQUIP.EquipItem> equipment in _user_data.Equip.Dic)
            {
                if (equipment.Value == null)
                {
                    continue;
                }

                EquipId equip_id = new EquipId()
                {
                    Id        = equipment.Value.EquipInfo.Id,
                    Name      = equipment.Value.EquipInfo.Name,
                    Refine    = equipment.Value.Refine,
                    ImageRoot = equipment.Value.EquipInfo.ImageName
                };
                SetUserItemChanged(equip_id, equipment.Key);
            }

            string job_name = Enum.GetName(typeof(JOB_SELECT_LIST), ((int)((int)_user_data.Job / 100) * 100)).ToLower();
            string filename = "Resources/Job/" + job_name + ".png";

            Image_Char.Source = new BitmapImage(ResourceExtension.GetAssemblyUri(filename));
        }
示例#3
0
        /// <summary>
        /// Recovers a given number of Resource IDs
        /// </summary>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="cancellationToken"></param>
        /// <returns><c>DocumentCollection</c> with the resource IDs recovered</returns>
        public async Task <DocumentCollection> GetIdsAsync(int skip = 0, int take = 100, CancellationToken cancellationToken = default(CancellationToken))
        {
            var resourceExtension = new ResourceExtension(_sender);
            var resource          = await resourceExtension.GetIdsAsync(skip, take, cancellationToken).ConfigureAwait(false);

            return(resource);
        }
示例#4
0
        void JobSelectedEvent()
        {
            string job_name = Enum.GetName(typeof(JOB_SELECT_LIST), ((int)((int)_user_data.Job / 100) * 100)).ToLower();
            string filename = "Resources/Job/" + job_name + ".png";

            Image_Char.Source = new BitmapImage(ResourceExtension.GetAssemblyUri(filename));
        }
示例#5
0
        private void CreateFolder()
        {
            var path = Path.Combine(Environment.CurrentDirectory, "Img");

            ResourceExtension.CreateFolder(path);
            path = Path.Combine(Environment.CurrentDirectory, "user");
            ResourceExtension.CreateFolder(path);
        }
        public static PropertySearchInfo[] GetPropertyByIndex(Type type, int index)
        {
            var searchAttributesProps = type.GetProperties().Where(prop => Attribute.IsDefined(prop, typeof(SearchAttribute), true));
            var elemTypeInput         = AgroHelper.GetEntityType((EntityRelated)index, typeof(BarrackInput), "trifenix.agro.model.external.Input");


            var elemTypeInputProps = elemTypeInput.GetProperties().Where(prop => Attribute.IsDefined(prop, typeof(SearchAttribute), true))
                                     .Select(s => new { info = s, search = s.GetAttribute <SearchAttribute>(), required = s.GetAttribute <RequiredAttribute>(), unique = s.GetAttribute <UniqueAttribute>() });



            var props = searchAttributesProps.Select(s => {
                var searchAttribute      = (SearchAttribute)s.GetCustomAttributes(typeof(SearchAttribute), true).FirstOrDefault();
                var searchAttributeInput = elemTypeInputProps.FirstOrDefault(p => p.search.Index == searchAttribute.Index && p.search.Related == searchAttribute.Related);

                return(new PropertySearchInfo {
                    IsEnumerable = IsEnumerableProperty(s),
                    Name = s.Name,
                    Index = searchAttribute.Index,
                    Related = searchAttribute.Related,
                    Enums = searchAttribute.Related == Related.ENUM ? GetDescription(s.PropertyType) : new Dictionary <int, string>(),
                    IndexClass = index,
                    Info = ResourceExtension.ResourceModel(searchAttribute.Related, searchAttribute.Index),
                    IsRequired = searchAttributeInput?.required != null,
                    IsUnique = searchAttributeInput?.unique != null,
                    AutoNumeric = searchAttribute.GetType() == typeof(AutoNumericSearchAttribute),
                    Visible = searchAttribute.Visible,
                    HasInput = searchAttributeInput != null
                });
            }).ToArray();


            //si existe alguna propiead que esté en el input y no esté en la entidad.
            if (elemTypeInputProps.Any(s => !props.Any(a => a.Name.Equals(s.info.Name))))
            {
                var extra = elemTypeInputProps.Where(s => !props.Any(a => a.Name.Equals(s.info.Name)));
                var list  = props.ToList();
                foreach (var item in extra)
                {
                    list.Add(new PropertySearchInfo
                    {
                        IsEnumerable = IsEnumerableProperty(item.info),
                        Name         = item.info.Name,
                        Index        = item.search.Index,
                        Related      = item.search.Related,
                        Enums        = item.search.Related == Related.ENUM ? GetDescription(item.info.PropertyType) : new Dictionary <int, string>(),
                        IndexClass   = index,
                        Info         = ResourceExtension.ResourceModel(item.search.Related, item.search.Index),
                        IsRequired   = item?.required != null,
                        IsUnique     = item?.unique != null,
                    });
                }
                props = list.ToArray();
            }
            return(props);
        }
示例#7
0
            void GetImage()
            {
                if (_name == null)
                {
                    return;
                }
                string resource_name = "Resources/ConsumableBuff/" + _name + ".png";

                _image = new BitmapImage(ResourceExtension.GetAssemblyUri(resource_name));
            }
        public static ModelDictionary GetModel(IEnumerable <PropertySearchInfo> propertySearchInfos, EntityRelated index)
        {
            var propByRelatedAndIndex = propertySearchInfos.GroupBy(s => new { s.Related, s.IndexClass, s.Index }).Select(s => s.FirstOrDefault());
            var enumEmun        = GetDescription(typeof(EnumRelated));
            var modelInfo       = ResourceExtension.ResourceModel(Related.REFERENCE, propByRelatedAndIndex.FirstOrDefault().IndexClass);
            var modelDictionary = new ModelDictionary()
            {
                Index       = index,
                Description = modelInfo.Description,
                ShortName   = modelInfo.ShortName,
                Title       = modelInfo.Title,
                BoolData    = GetDictionaryFromRelated(propByRelatedAndIndex, Related.BOOL),
                StringData  = GetDictionaryFromRelated(propByRelatedAndIndex, Related.STR),
                DateData    = GetDictionaryFromRelated(propByRelatedAndIndex, Related.DATE),
                DoubleData  = GetDictionaryFromRelated(propByRelatedAndIndex, Related.DBL),
                EnumData    = GetEnumDictionaryFromRelated(propByRelatedAndIndex, enumEmun),
                GeoData     = GetDictionaryFromRelated(propByRelatedAndIndex, Related.GEO),
                NumData     = GetDictionaryFromRelated(propByRelatedAndIndex, Related.NUM32),
                relData     = GetDictionaryFromRelated(propByRelatedAndIndex, Related.REFERENCE),
            };
            var suggestions           = GetDictionaryFromRelated(propByRelatedAndIndex, Related.SUGGESTION);
            var num64                 = GetDictionaryFromRelated(propByRelatedAndIndex, Related.NUM64);
            var suggestionNotInString = suggestions.Where(sg => !modelDictionary.StringData.Any(s => s.Key == sg.Key));
            var num64NotInNum         = num64.Where(sg => !modelDictionary.NumData.Any(s => s.Key == sg.Key));
            var relLocal              = GetDictionaryFromRelated(propByRelatedAndIndex, Related.LOCAL_REFERENCE);

            if (suggestionNotInString.Any())
            {
                foreach (var item in suggestionNotInString)
                {
                    modelDictionary.StringData.Add(item.Key, item.Value);
                }
            }
            if (num64NotInNum.Any())
            {
                foreach (var item in num64NotInNum)
                {
                    modelDictionary.NumData.Add(item.Key, item.Value);
                }
            }
            if (relLocal.Any())
            {
                foreach (var item in relLocal)
                {
                    modelDictionary.relData.Add(item.Key, item.Value);
                }
            }


            return(modelDictionary);
        }
示例#9
0
        void GetImage()
        {
            //if ((_image_name == null) || (_image_name == ""))
            //{
            //    string filename = "Resources/image-not-found1.png";
            //    Image_Char.Source = new BitmapImage(ResourceExtension.GetUri(filename));
            //}
            //else
            //{

            //}

            var path = System.IO.Path.Combine(Environment.CurrentDirectory, "Img", _image_name);

            _image = new BitmapImage(ResourceExtension.GetUri(path));
        }
示例#10
0
        public static void ReadDB(UserData User, int file_number = 1)
        {
            string file_name = string.Format("{0}{1}{2}{3}", default_path, default_file_name, file_number, default_file_extension);

            if (!ResourceExtension.IsFileExists(file_name))
            {
                User = new UserData();
                return;
            }

            var serializeOptions = new JsonSerializerOptions();

            serializeOptions.Converters.Add(new JsonConvertExt_Dic_int_DB());
            serializeOptions.Converters.Add(new JsonConvertExt_Dic_Enum_BasicType());
            serializeOptions.WriteIndented = true;

            string jsonString = File.ReadAllText(file_name);

            User = JsonSerializer.Deserialize <UserData>(jsonString, serializeOptions);
        }
        public async Task ReceiveAsync(Message envelope, CancellationToken cancellationToken = default(CancellationToken))
        {
            //Pegando Informações do usuário
            DirectoryExtension d = new DirectoryExtension(_sender);
            var x = d.GetDirectoryAccountAsync(envelope.From.ToIdentity(), cancellationToken).Result;



            //Armazenando recursos
            ResourceExtension r = new ResourceExtension(_sender);
            var retorno         = r.SetAsync <PlainText>("123649", new PlainText {
                Text = "Votações do Deputado"
            });
            PlainText teste = null;

            if (!retorno.IsCompleted)
            {
                teste = r.GetAsync <PlainText>("123649").Result;
            }

            await _sender.SendMessageAsync(teste.Text, envelope.From, cancellationToken);
        }
示例#12
0
        void GetImage()
        {
            var path = System.IO.Path.Combine(Environment.CurrentDirectory, "Img", _image_name);

            _image = new BitmapImage(ResourceExtension.GetUri(path));
        }
示例#13
0
 /// <summary>
 /// Set a <paramref name="document"/> on BLiP's Resources using a given <paramref name="id"/>
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="id"></param>
 /// <param name="document"></param>
 /// <param name="expiration"></param>
 /// <param name="cancellationToken"></param>
 public async Task SetAsync <T>(string id, T document, TimeSpan expiration = default(TimeSpan), CancellationToken cancellationToken = default(CancellationToken)) where T : Document
 {
     var resourceExtension = new ResourceExtension(_sender);
     await resourceExtension.SetAsync <T>(id, document, expiration, cancellationToken).ConfigureAwait(false);
 }
示例#14
0
 /// <summary>
 /// Deletes the resource with the given <paramref name="id"/>
 /// </summary>
 /// <param name="id">Unique id for the resource to be deleted</param>
 /// <param name="cancellationToken"></param>
 public async Task DeleteAsync(string id, CancellationToken cancellationToken = default(CancellationToken))
 {
     var resourceExtension = new ResourceExtension(_sender);
     await resourceExtension.DeleteAsync(id, cancellationToken);
 }
示例#15
0
        protected override async void OnCreate(Bundle bundle)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            CurrentTheme  = Settings.SelectedTheme;
            CurrentAccent = AndroidColourThemeHelper.CurrentTheme;
            SetRightTheme();
            ResourceExtension.Init();
            base.OnCreate(bundle);
            if (Resources.DisplayMetrics.WidthPixels >= 1080)
            {
                Settings.MakeGridItemsSmaller = true;
            }

            AnimeListPageFragment.RightDrawer = null;
            if (!_addedNavHandlers)
            {
                RegisterIoC();
                SetContentView(Resource.Layout.MainPage);
                InitAdContainer();
                InitBindings();
                ViewModel.MainNavigationRequested += ViewModelOnMainNavigationRequested;
                ViewModel.MainNavigationRequested += ViewModelOnMainNavigationRequestedFirst;
                ViewModel.MediaElementCollapsed   += ViewModelOnMediaElementCollapsed;

                ViewModelLocator.AnimeList.DimensionsProvider = this;

                var args = Intent.Extras?.GetString("launchArgs") ?? Intent.Data?.ToString();
                ProcessLaunchArgs(args, true);
                ViewModel.PerformFirstNavigation();

                DroppyMenuPopup.RequestedElevation = DimensionsHelper.DpToPx(10);

                ResourceLocator.NotificationsTaskManager.StartTask(BgTasks.Notifications);


                //if ((Resources.Configuration.ScreenLayout & ScreenLayout.SizeMask) == ScreenLayout.SizeSmall)
                //{
                //    Settings.PullHigherQualityImages = false;
                //}


                DroppyMenuPopup.OverrideRequested +=
                    (sender, action) => ViewModelLocator.NavMgr.RegisterOneTimeMainOverride(new RelayCommand(action));
                DroppyMenuPopup.ResetOverrideRequested +=
                    (sender, eventArgs) => ViewModelLocator.NavMgr.ResetOneTimeOverride();

                //Check permissions
                var requiredPermission = new List <string>();
                if (ContextCompat.CheckSelfPermission(this,
                                                      Manifest.Permission.ReadExternalStorage)
                    != Permission.Granted)
                {
                    requiredPermission.Add(Manifest.Permission.ReadExternalStorage);
                }

                if (ContextCompat.CheckSelfPermission(this,
                                                      Manifest.Permission.WriteExternalStorage)
                    != Permission.Granted)
                {
                    requiredPermission.Add(Manifest.Permission.WriteExternalStorage);
                }

                if (requiredPermission.Any())
                {
                    ActivityCompat.RequestPermissions(this,
                                                      requiredPermission.ToArray(), 129055);
                }
                _addedNavHandlers = true;
            }

            if (!_staticInitPerformed)
            {
                StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().PermitAll().Build();
                StrictMode.SetThreadPolicy(policy);

                InitializationRoutines.InitPostUpdate();

                await Task.Delay(1000);

                if (ResourceLocator.ChangelogProvider.NewChangelog)
                {
                    ChangelogDialog.BuildChangelogDialog(ResourceLocator.ChangelogProvider);
                }

                RateReminderPopUp.ProcessRatePopUp();

                MemoryWatcher.Watcher.Resume(true);
                ResourceLocator.TelemetryProvider.Init();

                _staticInitPerformed = true;
            }
        }
示例#16
0
        public byte[] CreateNamesTable(Dictionary <string, ResourceItem> resourceFlatView, out Dictionary <string, int> resourcesOffsets)
        {
            resourcesOffsets = new Dictionary <string, int>();
            List <ResourceNameItem> resourceNames = new List <ResourceNameItem>();

            ResourceExtension[] extensionsName = Utils.GetExtensionTable();
            int currentPosition = POSITION_NAME_START;
            int namesPadding    = 0;

            byte[] names = null;

            using (MemoryStream streamNames = new MemoryStream())
            {
                using (BinaryWriter writerNames = new BinaryWriter(streamNames))
                {
                    //Initial bytes
                    writerNames.Seek(4 + POSITION_NAME_START, SeekOrigin.Begin);

                    foreach (ResourceItem rItem in resourceFlatView.Values)
                    {
                        string name = rItem.Filename;

                        //If extension, remove the extension, and add it if new extension
                        int extensionFlag = 0;
                        if (!rItem.IsFolder)
                        {
                            if (name.Contains("."))
                            {
                                string extension = name.Substring(name.LastIndexOf("."));
                                name = name.Substring(0, name.LastIndexOf("."));
                                ResourceExtension extensionItem = extensionsName.LastOrDefault(p => p.Name == extension);
                                if (extensionItem == null)
                                {
                                    throw new Exception("Extension not found!");
                                }

                                if (extensionItem.Offset == 0)
                                {
                                    writerNames.Write(Encoding.ASCII.GetBytes(extension));
                                    writerNames.Write((byte)0);
                                    extensionItem.Offset = currentPosition;
                                    currentPosition     += (extension.Length + 1);
                                }
                                extensionFlag = extensionItem.Flag;
                            }
                        }

                        //If name already exists, return its offset
                        ResourceNameItem nameItem = resourceNames.Find(p => p.Name == name);
                        if (nameItem != null)
                        {
                            resourcesOffsets.Add(rItem.RelativePath, nameItem.Offset | extensionFlag);
                            continue;
                        }

                        //Code to prevent reading a name between 2 blocks of 0x2000
                        for (int i = 0; i < name.Length + 4; i++)
                        {
                            if ((currentPosition + i) % 0x2000 == 0)
                            {
                                for (int j = 0; j < i; j++)
                                {
                                    writerNames.Write((byte)0);
                                }
                                currentPosition += i;
                            }
                        }

                        //The name doesnt exist at all, creating it
                        writerNames.Write(Encoding.ASCII.GetBytes(name));
                        writerNames.Write((byte)0);
                        resourceNames.Add(new ResourceNameItem()
                        {
                            Name = name, Offset = currentPosition
                        });
                        resourcesOffsets.Add(rItem.RelativePath, currentPosition | extensionFlag);
                        currentPosition += name.Length + 1;
                    }

                    //Name padding
                    namesPadding = currentPosition; //the first 4 bits are not part of the string table
                    while (namesPadding % 0x2000 != 0)
                    {
                        namesPadding++;
                    }
                    writerNames.Seek(namesPadding - currentPosition, SeekOrigin.End);

                    //Writing extensions
                    writerNames.Write(extensionsName.Length);
                    foreach (ResourceExtension nameItem in extensionsName)
                    {
                        writerNames.Write(nameItem.Offset);
                    }
                }
                names = streamNames.ToArray();
            }
            names[0] = (byte)(namesPadding / 0x2000);
            return(names);
        }
示例#17
0
 public static T LoadDataBase <T>(string name)
 {
     if (!ResourceExtension.IsFileExists(file_relative_root + name))
     {
         return(default);
示例#18
0
        internal static ResourceExtension[] GetExtensionTable()
        {
            _ResourceExtensionsTable       = new ResourceExtension[0x46];
            _ResourceExtensionsTable[0x00] = new ResourceExtension("", 0x0000000);
            _ResourceExtensionsTable[0x01] = new ResourceExtension(".bin", 0x1000000); //Exception to the 1024Kb rule for compression (bigger files arent compressed)
            _ResourceExtensionsTable[0x02] = new ResourceExtension(".nuf", 0x2000000);
            _ResourceExtensionsTable[0x03] = new ResourceExtension(".nut", 0x3000000); //Exception to the 1024Kb rule for compression (bigger files arent compressed)
            _ResourceExtensionsTable[0x04] = new ResourceExtension(".efc", 0x4000000);
            _ResourceExtensionsTable[0x05] = new ResourceExtension(".ptcl", 0x5000000);
            _ResourceExtensionsTable[0x06] = new ResourceExtension(".mta", 0x6000000); //Exception to the 1024Kb rule for compression (some smaller files are compressed)
            _ResourceExtensionsTable[0x07] = new ResourceExtension(".nud", 0x7000000);
            _ResourceExtensionsTable[0x08] = new ResourceExtension(".omo", 0x8000000); //Exception to the 1024Kb rule for compression (some smaller files are compressed, some bigger files arent compressed)
            _ResourceExtensionsTable[0x09] = new ResourceExtension(".vbn", 0x9000000);
            _ResourceExtensionsTable[0x0a] = new ResourceExtension(".xmb", 0xa000000); //Exception to the 1024Kb rule for compression (some smaller files are compressed)
            _ResourceExtensionsTable[0x0b] = new ResourceExtension(".xmta", 0xb000000);
            _ResourceExtensionsTable[0x0c] = new ResourceExtension(".jtb", 0xc000000);
            _ResourceExtensionsTable[0x0d] = new ResourceExtension(".nhb", 0xd000000);
            _ResourceExtensionsTable[0x0e] = new ResourceExtension(".sb", 0xe000000);
            _ResourceExtensionsTable[0x0f] = new ResourceExtension(".pac", 0xf000000); //Exception to the 1024Kb rule for compression (some smaller files are compressed, some bigger files arent compressed)
            _ResourceExtensionsTable[0x10] = new ResourceExtension(".flp", 0x10000000);
            _ResourceExtensionsTable[0x11] = new ResourceExtension(".ik", 0x11000000);
            _ResourceExtensionsTable[0x12] = new ResourceExtension(".moi", 0x12000000);
            _ResourceExtensionsTable[0x13] = new ResourceExtension(".sbwl", 0x13000000);
            _ResourceExtensionsTable[0x14] = new ResourceExtension(".mtable", 0x14000000);   //Exception to the 1024Kb rule for compression (bigger files arent compressed), seems random.
            _ResourceExtensionsTable[0x15] = new ResourceExtension(".mscsb", 0x15000000);
            _ResourceExtensionsTable[0x16] = new ResourceExtension(".nus3bank", 0x16000000); //Exception to the 1024Kb rule for compression (bigger files arent compressed): stage sounds, enemy sounds, se and vc of fighters arent compressed
            _ResourceExtensionsTable[0x17] = new ResourceExtension(".sqb", 0x17000000);
            _ResourceExtensionsTable[0x18] = new ResourceExtension(".vat", 0x18000000);
            _ResourceExtensionsTable[0x19] = new ResourceExtension(".mir", 0x19000000);
            _ResourceExtensionsTable[0x1a] = new ResourceExtension(".cms", 0x1a000000);
            _ResourceExtensionsTable[0x1b] = new ResourceExtension(".lvd", 0x1b000000);
            _ResourceExtensionsTable[0x1c] = new ResourceExtension(".mfp", 0x1c000000);
            _ResourceExtensionsTable[0x1d] = new ResourceExtension(".exi", 0x1d000000);
            _ResourceExtensionsTable[0x1e] = new ResourceExtension(".obt", 0x1e000000);
            _ResourceExtensionsTable[0x1f] = new ResourceExtension(".gya", 0x1f000000);
            _ResourceExtensionsTable[0x20] = new ResourceExtension(".h", 0x20000000);
            _ResourceExtensionsTable[0x21] = new ResourceExtension(".log", 0x21000000);
            _ResourceExtensionsTable[0x22] = new ResourceExtension(".mtmp", 0x22000000);
            _ResourceExtensionsTable[0x23] = new ResourceExtension(".nhbxml", 0x23000000);
            _ResourceExtensionsTable[0x24] = new ResourceExtension(".sa", 0x24000000);
            _ResourceExtensionsTable[0x25] = new ResourceExtension(".tdb", 0x25000000);
            _ResourceExtensionsTable[0x26] = new ResourceExtension(".xmbxml", 0x26000000);
            _ResourceExtensionsTable[0x27] = new ResourceExtension(".hkt", 0x27000000);
            _ResourceExtensionsTable[0x28] = new ResourceExtension(".HKX", 0x28000000);
            _ResourceExtensionsTable[0x29] = new ResourceExtension(".mbm", 0x29000000);
            _ResourceExtensionsTable[0x2a] = new ResourceExtension(".gsh", 0x2a000000);
            _ResourceExtensionsTable[0x2b] = new ResourceExtension(".xtal", 0x2b000000);
            _ResourceExtensionsTable[0x2c] = new ResourceExtension(".nsh", 0x2c000000);
            _ResourceExtensionsTable[0x2d] = new ResourceExtension(".rsm", 0x2d000000);
            _ResourceExtensionsTable[0x2e] = new ResourceExtension(".vew", 0x2e000000);
            _ResourceExtensionsTable[0x2f] = new ResourceExtension(".fbb", 0x2f000000);
            _ResourceExtensionsTable[0x30] = new ResourceExtension(".mmb", 0x30000000);
            _ResourceExtensionsTable[0x31] = new ResourceExtension(".mpb", 0x31000000);
            _ResourceExtensionsTable[0x32] = new ResourceExtension(".csb", 0x32000000);
            _ResourceExtensionsTable[0x33] = new ResourceExtension(".nus3conf", 0x33000000);
            _ResourceExtensionsTable[0x34] = new ResourceExtension(".nus3conf3d", 0x34000000);
            _ResourceExtensionsTable[0x35] = new ResourceExtension(".mtb", 0x35000000);
            _ResourceExtensionsTable[0x36] = new ResourceExtension(".spt", 0x36000000);
            _ResourceExtensionsTable[0x37] = new ResourceExtension(".fnv", 0x37000000);
            _ResourceExtensionsTable[0x38] = new ResourceExtension(".svt", 0x38000000);
            _ResourceExtensionsTable[0x39] = new ResourceExtension(".local", 0x39000000);
            _ResourceExtensionsTable[0x3a] = new ResourceExtension(".brf", 0x3a000000);
            _ResourceExtensionsTable[0x3b] = new ResourceExtension(".tex", 0x3b000000);
            _ResourceExtensionsTable[0x3c] = new ResourceExtension(".texatlas", 0x3c000000);
            _ResourceExtensionsTable[0x3d] = new ResourceExtension(".fgb", 0x3d000000);
            _ResourceExtensionsTable[0x3e] = new ResourceExtension(".flx", 0x3e000000);
            _ResourceExtensionsTable[0x3f] = new ResourceExtension(".lst", 0x3f000000);
            _ResourceExtensionsTable[0x40] = new ResourceExtension(".tinf", 0x40000000);
            _ResourceExtensionsTable[0x41] = new ResourceExtension(".lm", 0x41000000);
            _ResourceExtensionsTable[0x42] = new ResourceExtension(".msb", 0x42000000);
            _ResourceExtensionsTable[0x43] = new ResourceExtension(".msbt", 0x43000000);
            _ResourceExtensionsTable[0x44] = new ResourceExtension(".txt", 0x44000000);
            _ResourceExtensionsTable[0x45] = new ResourceExtension(".tga", 0x45000000);

            return(_ResourceExtensionsTable);
        }
示例#19
0
    public static void ParseCardData()
    {
        foreach (var typeName in typeof(CardType).GetEnumNames())
        {
            string     texts = Resources.Load <Text>(CSVPath + typeName).text;
            string[][] datas = texts.Split('\n').                   // string[]
                               Select(x => x.Split(',')).ToArray(); // string[][]

            foreach (var data in datas)
            {
                if (data[0].Equals("card_id"))
                {
                    continue;
                }

                Card.CardFXData fxData = ResourceExtension.LoadCardFXData(fileName: data[1]);

                if (typeName.Equals("Attack"))
                {
                    _attackCards.Add(
                        int.Parse(data[0]),
                        new AttackCard(
                            cardId: int.Parse(data[0]),
                            cardName: data[1],
                            range: (int.Parse(data[2]), int.Parse(data[3])),
                            amount: int.Parse(data[4]),
                            description: data[5],
                            fxData: fxData
                            ));
                }
                else if (typeName.Equals("Shield"))
                {
                    _shieldCards.Add(
                        int.Parse(data[0]),
                        new ShieldCard(
                            cardId: int.Parse(data[0]),
                            cardName: data[1],
                            rotation: byte.Parse(data[2]),
                            amount: int.Parse(data[3]),
                            description: data[4],
                            fxData: fxData
                            ));
                }
                else if (typeName.Equals("Skill"))
                {
                    byte[] range = data[3].Split(' ').
                                   Select(x => byte.Parse(x)).ToArray();

                    _skillCards.Add(
                        int.Parse(data[0]),
                        new SkillCard(
                            cardId: int.Parse(data[0]),
                            cardName: data[1],
                            range: range,
                            amount: int.Parse(data[3]),
                            description: data[4],
                            fxData: fxData
                            ));
                }
            }
        }
    }