/// <inheritdoc />
        public Armor Convert(ItemDTO value, object state)
        {
            var entity = new Shoulders();

            this.Merge(entity, value, state);
            return(entity);
        }
Beispiel #2
0
        public String NameOfPart(int partNum)   // I am truly sorry for this method!
        {
            String name    = "";
            Part   thePart = parts[partNum];

            if (thePart is Head)
            {
                Head head = (Head)thePart;
                name  = "Head: " + thePart.PartName;
                name += " Class: " + (int)head.PartRank;
                name += " Scan Level: " + (int)head.EnemyScanAbility;
                name += " Missle Defense Rate: " + head.MissileInterceptionRate;
            }
            if (thePart is Core)
            {
                Core core = (Core)thePart;
                name  = "Core: " + thePart.PartName;
                name += " Class:" + (int)core.PartRank;
                name += " HP: " + core.MaxHp;
            }
            if (thePart is LeftArm)
            {
                LeftArm leftArm = (LeftArm)thePart;
                name  = "Left Arm: " + thePart.PartName;
                name += " Class: " + (int)leftArm.PartRank;
                name += " Blade Length: " + leftArm.SwordLength;
                name += " Blade Damage: " + leftArm.SwordDamage;
            }
            if (thePart is RightArm)
            {
                RightArm rightArm = (RightArm)thePart;
                name  = "Right Arm: " + thePart.PartName;
                name += " Class: " + (int)rightArm.PartRank;
                name += " Size: " + rightArm.ProjectileSize;
                name += " Damage: " + rightArm.Damage;
            }
            if (thePart is Shoulders)
            {
                Shoulders shoudlers = (Shoulders)thePart;
                name  = "Shoulder: " + thePart.PartName;
                name += " Class: " + (int)shoudlers.PartRank;
                name += " Size: " + shoudlers.MissleSize;
                name += " Damage: " + shoudlers.Damage;
            }
            if (thePart is Legs)
            {
                Legs legs = (Legs)thePart;
                name  = "Legs: " + thePart.PartName;
                name += " Class: " + (int)legs.PartRank;
                name += " Speed: " + legs.SpeedTilesPerSecond;
                name += " Hover: " + ((legs.Movement.Water != MoveQuality.none) ? "True" : "False");
                name += " Heat Resist: " + ((legs.Movement.Water != MoveQuality.none) ? "True" : "False");
            }

            return(name);
        }
 // Implement this method in a buddy class to set properties that are specific to 'Shoulders' (if any)
 partial void Merge(Shoulders entity, ItemDTO dto, object state);