Gruppe22.Backend.Actor.copyFrom C# (CSharp) Метод

copyFrom() публичный Метод

Duplicates the properties of actor a to the current actor.
public copyFrom ( Actor a ) : void
a Actor The actor from which the properties should be cloned
Результат void
        public void copyFrom(Actor a)
        {
            _actorType = a.actorType;
            _armor = a.armor;
            _mana = a.mana;
            _damage = a.damage;
            _exp = a.exp;
            _expNeeded = a.expNeeded;
            _GUID = a.GUID;
            _gold = a.gold;
            _health = a.health;
            _inventory = a.inventory;
            if ((a is Player) && (this is Player))
            {
                (this as Player).ClearQuests();
                Quest[] myQuests = (a as Player).quests;
                foreach (Quest q in myQuests)
                {
                    (this as Player).AddQuest(q);
                }
            }
            foreach (Item i in _inventory)
            {
                i.owner = this;
            }
            _level = a.level;
            _animationFile = a.animationFile;
            _manaReg = a.manaReg;
            _maxhealth = a.maxHealth;
            _maxMana = a.maxMana;
            _name = a.name;
            _evade = a.evade;
            _block = a.block;
            _penetrate = a.penetrate;
            _healthReg = a.healthReg;
            _skills = a.skills;
            _abilityPoints = a.abilityPoints;
            _armor = a.armor;
            _stealHealth = a.stealHealth;
            _stealMana = a.stealMana;
            _fireDamage = a.fireDamage;
            _iceDamage = a.iceDamage;
            _fireDefense = a.fireDefense;
            _iceDefense = a.iceDefense;
            _expNeeded = a.expNeeded;
            _exp = a.exp;
            _resist = a.resist;
            _viewRange = a.viewRange;
            _damage = a.damage;
            _level = a.level;
            _locked = a.locked;
            _manaReg = a.manaReg;
            _maxMana = a.maxMana;
            _destroyWeapon = a.destroyWeapon;
            _destroyArmor = a.destroyArmor;
            _scared = a.scared;
            _stunned = a.stunned;
            _charmed = a.charmed;
            _quicklist = a.quickList;
            _checkPointCoords = a.checkPointCoords;
            _lastCheckpoint = a.lastCheckpoint;
            _abilities = a.abilities;
            _lives = a.lives;
            _direction = a.direction;

            if ((a.actorType == ActorType.NPC) && (actorType == ActorType.NPC))
            {
                NPC n = a as NPC;
                NPC t = this as NPC;

                if (a != null)
                {
                    t.love = n.love;
                    t.hasShop = n.hasShop;
                }
            }
        }