47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using UnityEngine;
|
|
using Vanguard.Api.Contracts;
|
|
using Vanguard.Auth;
|
|
using Vanguard.Meta;
|
|
using Vanguard.State;
|
|
using Vanguard.UI;
|
|
|
|
namespace Vanguard.App
|
|
{
|
|
public sealed class DeckBuilderSceneController : SceneControllerBase
|
|
{
|
|
private DeckBuilderView _view;
|
|
private PlayerTopBar _topBar;
|
|
|
|
private void Start()
|
|
{
|
|
SceneEnvironment.Build(SceneTheme.DeckBuilder);
|
|
var canvas = CreateCanvas("DeckBuilder Canvas");
|
|
_view = new DeckBuilderView(
|
|
canvas.transform,
|
|
Resolve<MetaService>(),
|
|
Resolve<AuthService>(),
|
|
() => _ = Flow.LoadLobbyAsync(),
|
|
deck => _ = Flow.OpenLobbyWithQueueAsync(deck),
|
|
info => _ = Flow.LoadBattleAsync(info));
|
|
|
|
_topBar = new PlayerTopBar(
|
|
canvas.transform,
|
|
Resolve<AppConfig>(),
|
|
Resolve<PlayerState>(),
|
|
() => _ = Flow.LoadLoginAsync(),
|
|
null,
|
|
null,
|
|
null,
|
|
() => _ = Flow.LoadLobbyAsync());
|
|
|
|
_view.Show();
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
_view?.Hide();
|
|
_topBar?.Dispose();
|
|
}
|
|
}
|
|
}
|