Ejemplo n.º 1
0
        /// <summary>
        /// Gets random surname for an NPC.
        /// Supports Breton, Nord, Imperial, DarkElf, HighElf, WoodElf.
        /// All other types return empty string.
        /// </summary>
        public string Surname(BankTypes type)
        {
            // Bank dictionary must be ready
            if (bankDict == null)
            {
                return(string.Empty);
            }

            // Generate name by type
            NameBank nameBank = bankDict[type];
            string   lastName = string.Empty;

            switch (type)
            {
            case BankTypes.Breton:                                                      // These banks all work the same
            case BankTypes.Imperial:
            case BankTypes.DarkElf:
            case BankTypes.HighElf:
            case BankTypes.WoodElf:
                lastName = GetRandomSurname(nameBank);
                break;

            case BankTypes.Nord:
                lastName = GetRandomSurname(bankDict[BankTypes.Breton]);                // Nords appear to share Breton surnames
                break;
            }

            return(lastName);
        }
        /// <summary>
        /// Gets random first name for an NPC.
        /// Supports Breton, Redguard, Nord, Imperial, DarkElf, HighElf, WoodElf.
        /// All other types return empty string.
        /// </summary>
        public string FirstName(BankTypes type, Genders gender)
        {
            // Bank dictionary must be ready
            if (bankDict == null)
                return string.Empty;

            // Generate name by type
            NameBank nameBank = bankDict[type];
            string firstName = string.Empty;
            switch (type)
            {
                case BankTypes.Breton:                                                  // These banks all work the same
                case BankTypes.Nord:
                case BankTypes.Imperial:
                case BankTypes.DarkElf:
                case BankTypes.HighElf:
                case BankTypes.WoodElf:
                    firstName = GetRandomFirstName(nameBank, gender);
                    break;

                case BankTypes.Redguard:                                                // Redguards have just a single name
                    firstName = GetRandomRedguardName(nameBank, gender);
                    break;
            }

            return firstName;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets random first name for an NPC.
        /// Supports Breton, Redguard, Nord, Imperial, DarkElf, HighElf, WoodElf.
        /// All other types return empty string.
        /// </summary>
        public string FirstName(BankTypes type, Genders gender)
        {
            // Bank dictionary must be ready
            if (bankDict == null)
            {
                return(string.Empty);
            }

            // Generate name by type
            NameBank nameBank  = bankDict[type];
            string   firstName = string.Empty;

            switch (type)
            {
            case BankTypes.Breton:                                                      // These banks all work the same
            case BankTypes.Nord:
            case BankTypes.Imperial:
            case BankTypes.DarkElf:
            case BankTypes.HighElf:
            case BankTypes.WoodElf:
                firstName = GetRandomFirstName(nameBank, gender);
                break;

            case BankTypes.Redguard:                                                    // Redguards have just a single name
                firstName = GetRandomRedguardName(nameBank, gender);
                break;
            }

            return(firstName);
        }
Ejemplo n.º 4
0
        public IConfigurationService UseFromJSON(BankTypes bankTypes, string jsonValue)
        {
            var configuration  = Definition.BankConfiguration[bankTypes];
            var deserializeObj = System.Text.Json.JsonSerializer.Deserialize(jsonValue, configuration.GetType());

            Definition.BankConfiguration[bankTypes] = (IProviderConfiguration)deserializeObj;
            return(this);
        }
Ejemplo n.º 5
0
        internal static IBroker CreateBroker(BankTypes bankType)
        {
            switch (bankType)
            {
            case (BankTypes.CentralBank):
                return(new CBClass());

            case (BankTypes.TinkoffBank):
                return(new TBClass());
            }
            throw new Exception();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Gets random full name (first name + surname) for an NPC.
        /// Supports Breton, Redguard, Nord, Imperial, DarkElf, HighElf, WoodElf.
        /// All other types return empty string.
        /// </summary>
        public string FullName(BankTypes type, Genders gender)
        {
            // Get parts
            string firstName = FirstName(type, gender);
            string lastName  = Surname(type);

            // Compose full name
            string fullName = firstName;

            if (!string.IsNullOrEmpty(lastName))
            {
                fullName += " " + lastName;
            }

            return(fullName);
        }
Ejemplo n.º 7
0
        // Get random monster name.
        // Monster1: 0+(50% +1)+2
        // Monster2: 0+(50% +1)+2+(if female, +3)
        // Monster3: (if male, 25% +3 + " ")+0+1+2
        string GetRandomMonsterName(Genders gender)
        {
            BankTypes type     = (BankTypes)UnityEngine.Random.Range(8, 9 + 1); // Get random Monster1 or Monster2 for now.
            NameBank  nameBank = bankDict[type];

            // Get set parts
            string[] partsA, partsB, partsC, partsD;
            partsA = nameBank.sets[0].parts;
            partsB = nameBank.sets[1].parts;
            partsC = nameBank.sets[2].parts;
            partsD = null;

            string stringA = string.Empty;
            string stringB = string.Empty;
            string stringC = string.Empty;
            string stringD = string.Empty;

            uint index = 0;

            // Additional set for Monster2 and Monster3
            if (nameBank.sets.Length >= 4)
            {
                partsD = nameBank.sets[3].parts;
            }

            // Generate strings
            if (type != BankTypes.Monster3) // Monster1 or Monster2
            {
                index   = DFRandom.rand() % (uint)partsA.Length;
                stringA = partsA[index];

                stringB = string.Empty;
                if (DFRandom.rand() % 50 < 25)
                {
                    index   = DFRandom.rand() % (uint)partsB.Length;
                    stringB = partsB[index];
                }

                index   = DFRandom.rand() % (uint)partsC.Length;
                stringC = partsC[index];

                // Additional set for Monster2 female
                if (partsD != null && gender == Genders.Female)
                {
                    index   = DFRandom.rand() % (uint)partsD.Length;
                    stringD = partsD[index];
                }
            }
            else // Monster3
            {
                if (gender == Genders.Female || DFRandom.rand() % 100 >= 25)
                {
                    index   = DFRandom.rand() % (uint)partsA.Length;
                    stringA = partsA[index];
                }
                else
                {
                    index   = DFRandom.rand() % (uint)partsD.Length;
                    stringA = partsD[index] + " ";

                    index   = DFRandom.rand() % (uint)partsA.Length;
                    stringB = partsA[index];
                }

                index   = DFRandom.rand() % (uint)partsB.Length;
                stringC = partsB[index];

                index   = DFRandom.rand() % (uint)partsC.Length;
                stringD = partsC[index];
            }

            return(stringA + stringB + stringC + stringD);
        }
Ejemplo n.º 8
0
 private void mappingConfigurationNest(BankTypes nestBanks, NestPayConfiguration configuration)
 {
     Definition.BankConfiguration[nestBanks] = configuration;
 }
        /// <summary>
        /// Gets random surname for an NPC.
        /// Supports Breton, Nord, Imperial, DarkElf, HighElf, WoodElf.
        /// All other types return empty string.
        /// </summary>
        public string Surname(BankTypes type)
        {
            // Bank dictionary must be ready
            if (bankDict == null)
                return string.Empty;

            // Generate name by type
            NameBank nameBank = bankDict[type];
            string lastName = string.Empty;
            switch (type)
            {
                case BankTypes.Breton:                                                  // These banks all work the same
                case BankTypes.Imperial:
                case BankTypes.DarkElf:
                case BankTypes.HighElf:
                case BankTypes.WoodElf:
                    lastName = GetRandomSurname(nameBank);
                    break;

                case BankTypes.Nord:
                    lastName = GetRandomSurname(bankDict[BankTypes.Breton]);            // Nords appear to share Breton surnames
                    break;
            }

            return lastName;
        }
        /// <summary>
        /// Gets random full name (first name + surname) for an NPC.
        /// Supports Breton, Redguard, Nord, Imperial, DarkElf, HighElf, WoodElf.
        /// All other types return empty string.
        /// </summary>
        public string FullName(BankTypes type, Genders gender)
        {
            // Get parts
            string firstName = FirstName(type, gender);
            string lastName = Surname(type);

            // Compose full name
            string fullName = firstName;
            if (!string.IsNullOrEmpty(lastName))
                fullName += " " + lastName;

            return fullName;
        }
Ejemplo n.º 11
0
        public IEnumerable <Course> Get(BankTypes provider)
        {
            IBroker c = BrokerFactory.CreateBroker(provider);

            return(c.A());
        }