import openfl.events.Event;
import openfl.display.Sprite;

class Modes extends Sprite {
	var tilesButton:Button;
	var mobsButton:Button;

	public function new(editor:Main) {
		super();

		tilesButton = new Button('Tiles', () -> {
			editor.mode = Tiles;
		});
		mobsButton = new Button('Mobs', () -> {
			editor.mode = Mobs;
		});

		editor.addEventListener('mode', (even:Event) -> {
			tilesButton.selected = editor.mode == Tiles;
			mobsButton.selected = editor.mode == Mobs;
		});

		addChild(tilesButton);

		mobsButton.x = tilesButton.width + 10;

		addChild(mobsButton);
	}
}
