Ejemplo n.º 1
0
        private void GeneratePart(BodyPart part)
        {
            if (_hash == null)
            {
                _hash = Genes.Sha256();
            }

            int index = (int)part;

            int max;

            switch (part)
            {
            case BodyPart.Head:
            {
                if (Rarity == Rarity.Legendary)
                {
                    max = 128;
                }
                else
                {
                    max = 64;
                }

                break;
            }


            default:
                max = 32;
                break;
            }

            var element = new LuchadorPiece(_hash, index, part == BodyPart.Head ? 0 : 1, max);

            if (this.Rarity == Rarity.Bot)
            {
                if (part != BodyPart.Head)
                {
                    element.Variation = 0;
                }

                element.PrimaryHue   = SkinHue;
                element.SecondaryHue = SkinHue;
                element.TertiaryHue  = SkinHue;
                element.Shade        = SkinShade;
            }

            _elements[part] = element;
            index           = (index + 5) % (_hash.Length - 5);
        }