Exemplo n.º 1
0
        public override string ToString()
        {
            var result = new StringBuilder();

            // todo : header

            result.Append("{");

            var missingBars = 0;

            result.Append(BonesID);

            if (Skins == null || !Skins.Any())
            {
                missingBars++;
            }
            else
            {
                result.Append("|".ConcatCopy(missingBars + 1));
                missingBars = 0;
                result.Append(string.Join(",", Skins));
            }

            if (Colors == null || !Colors.Any())
            {
                missingBars++;
            }
            else
            {
                result.Append("|".ConcatCopy(missingBars + 1));
                missingBars = 0;
                result.Append(string.Join(",", from entry in Colors
                                          select entry.Key + "=" + entry.Value.ToArgb()));
            }

            if (Scales == null || !Scales.Any())
            {
                missingBars++;
            }
            else
            {
                result.Append("|".ConcatCopy(missingBars + 1));
                missingBars = 0;
                result.Append(string.Join(",", Scales));
            }

            if (SubLooks == null || !SubLooks.Any())
            {
                missingBars++;
            }
            else
            {
                result.Append("|".ConcatCopy(missingBars + 1));
                result.Append(string.Join(",", SubLooks.Select(entry => entry)));
            }

            result.Append("}");

            return(result.ToString());
        }
Exemplo n.º 2
0
        public Burning.DofusProtocol.Network.Types.EntityLook GetEntityLook()
        {
            List <uint> currentSkins = new List <uint>();

            foreach (var skin in Skins)
            {
                currentSkins.Add((uint)skin);
            }

            List <int> currentScales = new List <int>();

            foreach (var scale in Scales)
            {
                currentScales.Add((int)scale);
            }

            Burning.DofusProtocol.Network.Types.EntityLook entity = new Burning.DofusProtocol.Network.Types.EntityLook()
            {
                bonesId       = (uint)BonesID,
                scales        = currentScales,
                skins         = currentSkins,
                subentities   = SubLooks.Select(e => e.GetSubEntity()).ToList(),
                indexedColors = Colors.Select(entry => entry.Value + (16777216 * entry.Key)).ToList(),
            };
            return(entity);
        }
Exemplo n.º 3
0
 EntityLook BuildEntityLook() => new EntityLook(
     BonesID,
     Skins,
     Colors.Select(x => x.Key << 24 | x.Value.ToArgb() & 0xFFFFFF).ToArray(),
     Scales,
     SubLooks.Select(x => x.GetSubEntity()).ToArray());