Exemple #1
0
        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));
        }
Exemple #2
0
 void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window)
 {
     if (window.ListAbilities().All(ability => !ability.Usable))
     {
         window.Pass();
     }
 }
Exemple #3
0
 public void Represent(PaidWindow window, DropZone zone)
 {
     this.window = window;
     this.zone   = zone;
     gameObject.AddComponent <Highlight>().TurnOn();
     canvasGroup = gameObject.AddComponent <CanvasGroup>();
 }
Exemple #4
0
 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);
 }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        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));
        }
Exemple #8
0
        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));
        }
Exemple #9
0
 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;
 }
Exemple #10
0
        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;
                }
            }
        }
Exemple #11
0
 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;
 }
Exemple #12
0
 void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window)
 {
     SetActive(true);
     pass.transform.SetAsLastSibling();
     paidChoice.transform.SetAsLastSibling();
 }
Exemple #13
0
 void IPaidWindowObserver.NotifyPaidWindowClosed(PaidWindow window)
 {
     Log(window + " closed");
 }
Exemple #14
0
 void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window)
 {
     Log(window + " opened");
 }
Exemple #15
0
 void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window)
 {
     gameObject.SetActive(true);
 }
Exemple #16
0
 void IPaidWindowObserver.NotifyPaidWindowClosed(PaidWindow window)
 {
     gameObject.SetActive(false);
 }
Exemple #17
0
 void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window)
 {
     window.Pass();
 }
 void IPaidWindowObserver.NotifyPaidWindowOpened(PaidWindow window)
 {
     SetActive(true);
 }
Exemple #19
0
 void IPaidWindowObserver.NotifyPaidWindowClosed(PaidWindow window)
 {
 }