Ejemplo n.º 1
0
        public void RemoveWeapon(Weapon weapon)
        {
            Verify.That(weapon).Named("weapon").IsNotNull();

            if (!_weapons.ContainsKey(weapon))
                throw new IndexOutOfRangeException("Weapon list doesn't contain specified element.");

            // TODO
            //Scene.InputManager.UnsubscribeAllGestures(this, _weapons[weapon]);
            _weapons.Remove(weapon);
            Scene.RemoveComponent(weapon);
        }
Ejemplo n.º 2
0
        public void AddWeapon(Weapon weapon, GestureType gesture)
        {
            Verify.That(weapon).Named("weapon").IsNotNull();

            if (_weapons.ContainsKey(weapon))
                throw new IndexOutOfRangeException("Weapon list already contains specified element.");

            _weapons.Add(weapon, gesture);
            Scene.InputManager.SubscribeTap(this, message => weapon.Shot());

            Scene.AddComponent(weapon);
        }