private PaidWindowView WirePaidWindow(PaidWindow window) { var pass = GameObject.Find("Pass").AddComponent <PaidWindowPass>(); PaidChoice = GameObject.Find("Paid choice").AddComponent <DropZone>(); return(new PaidWindowView(window, pass, PaidChoice)); }
void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window) { if (window.ListAbilities().All(ability => !ability.Usable)) { window.Pass(); } }
public void Represent(PaidWindow window, DropZone zone) { this.window = window; this.zone = zone; gameObject.AddComponent <Highlight>().TurnOn(); canvasGroup = gameObject.AddComponent <CanvasGroup>(); }
public PaidWindowView(PaidWindow window, PaidWindowPass pass, DropZone paidChoice) { this.window = window; this.pass = pass; this.paidChoice = paidChoice; pass.Represent(window, paidChoice); SetActive(false); window.ObserveWindow(this); }
public void Represent(PaidWindow window) { this.window = window; var flag = CreateFlag(gameObject).AddComponent <PaidWindowFlag>(); var pass = CreatePass(gameObject).AddComponent <DropZone>(); flag.Represent(window, pass); gameObject.SetActive(false); window.ObserveWindow(this); }
private GameObject CreatePaidWindow(PaidWindow window) { var view = new GameObject("Paid window"); var rectangle = view.AddComponent <RectTransform>(); rectangle.anchorMin = new Vector2(0.0f, clickRowHeightRatio); rectangle.anchorMax = new Vector2(1.0f, 1.0f - clickRowHeightRatio); rectangle.offsetMin = Vector2.zero; rectangle.offsetMax = Vector2.zero; view.AddComponent <PaidWindowView>().Represent(window); return(view); }
private Corp CreateCorp(Player player) { var turn = new timing.corp.Turn(this); var paidWindow = new PaidWindow("corp"); var zones = new zones.corp.Zones( new zones.corp.Headquarters(this, new Random()), new zones.corp.ResearchAndDevelopment(this, player.deck, shuffling), new zones.corp.Archives(this), this ); var actionCard = new play.corp.ActionCard(zones, player.pilot); var clicks = new ClickPool(); var credits = new CreditPool(); return(new Corp(player.pilot, turn, paidWindow, actionCard, zones, clicks, credits, player.deck.identity)); }
private Runner CreateRunner(Player player) { var turn = new timing.runner.Turn(this); var paidWindow = new PaidWindow("runner"); var actionCard = new play.runner.ActionCard(player.pilot); var zones = new zones.runner.Zones( new zones.runner.Grip(), new zones.runner.Stack(player.deck, shuffling), new zones.runner.Heap(), new zones.runner.Rig(this, player.pilot), new zones.runner.Score(this) ); var clicks = new ClickPool(); var credits = new CreditPool(); return(new Runner(player.pilot, turn, paidWindow, actionCard, 0, zones, clicks, credits, player.deck.identity)); }
public Corp( IPilot pilot, Turn turn, PaidWindow paidWindow, ActionCard actionCard, zones.corp.Zones zones, ClickPool clicks, CreditPool credits, Card identity ) { this.pilot = pilot; this.turn = turn; this.paidWindow = paidWindow; this.actionCard = actionCard; this.zones = zones; this.clicks = clicks; this.credits = credits; this.identity = identity; }
async public Task OpenPaidWindow(PaidWindow acting, PaidWindow reacting) { var bothPlayersCouldAct = false; while (true) { var actingDeclined = await acting.AwaitPass(); if (actingDeclined && bothPlayersCouldAct) { break; } var reactingDeclined = await reacting.AwaitPass(); bothPlayersCouldAct = true; if (reactingDeclined && bothPlayersCouldAct) { break; } } }
public Runner( IPilot pilot, RunnerTurn turn, PaidWindow paidWindow, ActionCard actionCard, int tags, Zones zones, ClickPool clicks, CreditPool credits, Card identity ) { this.pilot = pilot; this.turn = turn; this.paidWindow = paidWindow; this.actionCard = actionCard; this.tags = tags; this.zones = zones; this.clicks = clicks; this.credits = credits; this.identity = identity; }
void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window) { SetActive(true); pass.transform.SetAsLastSibling(); paidChoice.transform.SetAsLastSibling(); }
void IPaidWindowObserver.NotifyPaidWindowClosed(PaidWindow window) { Log(window + " closed"); }
void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window) { Log(window + " opened"); }
void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window) { gameObject.SetActive(true); }
void IPaidWindowObserver.NotifyPaidWindowClosed(PaidWindow window) { gameObject.SetActive(false); }
void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window) { window.Pass(); }
void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window) { SetActive(true); }
void IPaidWindowObserver.NotifyPaidWindowClosed(PaidWindow window) { }