Ejemplo n.º 1
0
        private SoulstormItem(SoulstormItemType itemType, string key, string rusName, string engName)
        {
            ItemType = itemType;

            Key = key;

            RussianName = rusName;
            EnglishName = engName;
        }
        private SoulstormItem[] ShuffleSoulstormItems(SoulstormItemType itemsType, SoulstormItem[] items = null)
        {
            if (items == null || items.Length == 0)
            {
                items = itemsType == SoulstormItemType.Race ? ItemsProvider.Races : ItemsProvider.Maps;
            }

            items.Shuffle();
            return(items);
        }
        private SoulstormItem[] GenerateSoulstormItems(SoulstormItemType itemsType, uint count = 1, SoulstormItem[] items = null)
        {
            if (count < 1)
            {
                count = 1;
            }

            if (items == null || items.Length == 0)
            {
                items = itemsType == SoulstormItemType.Race ? ItemsProvider.Races: ItemsProvider.Maps;
            }

            var returnItems = new SoulstormItem[count];

            for (var i = 0; i < count; i++)
            {
                returnItems[i] = items[_random.Next(items.Length)];
            }
            return(returnItems);
        }