Beispiel #1
0
        public override void attack(int x, int y)
        {
            int damage = this.getWeapon().getDamage();
            int range  = this.getWeapon().getRange();

            AttackSubject.getInstance().Attack(damage, x, y, range);
        }
        public static AttackSubject getInstance()
        {
            if (_instance == null)
            {
                _instance = new AttackSubject();
            }

            return(_instance);
        }
Beispiel #3
0
        public override void attack(int x = 0, int y = 0)
        {
            x = Player.getInstance().getLocationX();
            y = Player.getInstance().getLocationY();
            int damage = this.getWeapon().getDamage();
            int range  = this.getWeapon().getRange();

            AttackSubject.getInstance().Attack(damage, x, y, range);
        }
Beispiel #4
0
 private Player()
 {
     AttackSubject.getInstance().register(this);
     this.setWeapon(new MotarGun());
     this.setEngine(new LightEngine());
 }
Beispiel #5
0
 public EnemyShip()
 {
     AttackSubject.getInstance().register(this);
     MoveSubject.getInstance().register(this);
 }