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

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

The constructor for a NPC. Initializes the standard properties and graphics for that NPC. See actor for the params.
public NPC ( int health = 10, int armor, int damage, int maxHealth = 10, string name = "", Random r = null, int _level = 1, bool shop = false ) : System
health int
armor int
damage int
maxHealth int
name string
r System.Random
_level int
shop bool
Результат System
        public NPC(int health = 10, int armor = 0, int damage = 0, int maxHealth = 10, string name = "", Random r = null, int _level = 1, bool shop = false)
            : base(ActorType.NPC, health, armor, damage, maxHealth, name, r)
        {
            _quests = new List<Quest>();
            _actorType = ActorType.NPC;
            if (shop) _animationFile = ".\\content\\luigi.xml";
            else
                switch (_level)
                {
                    case 1:
                        switch (_random.Next(3))
                        {
                            case 0:
                                _animationFile = ".\\content\\mage.xml";
                                break;
                            case 1:
                                _animationFile = ".\\content\\guard.xml";
                                break;
                            case 2:
                                _animationFile = ".\\content\\npc1.xml";
                                break;
                        }
                        break;
                    case 2:
                        switch (_random.Next(3))
                        {
                            case 0:
                                _animationFile = ".\\content\\mage.xml";
                                break;
                            case 1:
                                _animationFile = ".\\content\\monk.xml";
                                break;
                            case 2:
                                _animationFile = ".\\content\\npc1.xml";
                                break;
                        }
                        break;
                    default:
                        switch (_random.Next(3))
                        {
                            case 0:
                                _animationFile = ".\\content\\princess.xml";
                                break;
                            case 1:
                                _animationFile = ".\\content\\xmas.xml";
                                break;
                            case 2:
                                _animationFile = ".\\content\\npc1.xml";
                                break;
                        }
                        break;
                }
        }