Ejemplo n.º 1
0
        //public:
        public Ship(Int32 width_, Int32 height_)
        {
            Health = 100;
            _shield = 100;
            _type = ShipType.SmallShip;
            Width = width_;
            Height = height_;
            Damage = _type.basedamage;
            _bulletkind = BulletKind.Laser;
            _modules = new Dictionary<ModuleKind, Module>();

            foreach (ModuleKind val in Enum.GetValues(typeof(ModuleKind)))
            {
                _modules.Add(val, new Module(val));
            }
        }
Ejemplo n.º 2
0
        //fejlesztéshez műveletek
        public Boolean UpgradeShip()
        {
            //true->sikeres fejlesztés, false->nem az
            Damage -= _type.basedamage;
            if (_type.id == 0)
                _type = ShipType.MediumShip;
            else
                if (_type.id == 1)
                    _type = ShipType.BigShip;
            else return false;
            Damage += _type.basedamage;

            //minden modul vissza 0-ra
            foreach (ModuleKind val in Enum.GetValues(typeof(ModuleKind)))
            {
                RemoveModuleEffect(val);
                _modules.Remove(val);
                _modules.Add(val, new Module(val));
            }

            return true;
        }