package game.locations.elevatorHall;

import openfl.events.Event;

import game.locations.Location;
import game.locations.Interactive;

import aseprite.Aseprite;

class ElevatorHall extends Location {
  public function new() {
    super();

    id = 'elevatorHall';

    var inside: Interactive = new Interactive(false, game.locations.elevatorInside.ElevatorInside);
    inside.initBitmap(bmpPath('inside_elevator'));
    inside.x = 129;
    inside.y = 29;
    addChild(inside);

    var doors: ElevatorDoors = new ElevatorDoors();
    doors.x = 159;
    doors.y = 29;
    addChild(doors);

    addBmpLayer('hall_wall');

    var indicator: Aseprite = new Aseprite('assets/locations/elevatorHall/indicator');
    indicator.x = 142;
    indicator.y = 15;
    addChild(indicator);

    var button: ElevatorButton = new ElevatorButton(doors, indicator);
    button.x = 200;
    button.y = 60;
    button.addEventListener('opened', function(e: Event) {
      inside.actionable = true;
    });
    addChild(button);
  }
}
