Exemplo n.º 1
0
        public void Display(Game game, GameFlowView flowView, CorpView corpView, BoardParts parts)
        {
            var       presentBox = flowView.TimeCross.PresentBox;
            RigGrid   rigGrid    = new RigGrid(GameObject.Find("Rig"), game, flowView.PaidChoice, parts);
            HeapPile  heapPile   = new HeapPile(GameObject.Find("Heap"), game, parts);
            GripFan   gripFan    = new GripFan(GameObject.Find("Grip"), game, presentBox.RunnerActionPhase.AddComponent <DropZone>(), rigGrid.DropZone, heapPile.DropZone, parts);
            StackPile stackPile  = new StackPile(GameObject.Find("Stack"), game, gripFan.DropZone, parts);

            new ZoneBox(GameObject.Find("Runner/Left hand/Score"), parts).Represent(game.runner.zones.score.zone);
            parts.Print(GameObject.Find("Runner/Right hand/Core/Identity")).Print(game.runner.identity);
            new RunInitiation(
                gameObject: GameObject.Find("Run"),
                serverRow: corpView.serverRow,
                game: game
                );
            var credits = GameObject.Find("Runner/Credits");

            presentBox
            .BankCredit
            .AddComponent <Droppable>()
            .Represent(
                new InteractiveAbility(game.runner.actionCard.credit, credits.AddComponent <DropZone>(), game)
                );
            game.runner.credits.Observe(credits.AddComponent <CreditSpiral>());
            game.runner.credits.Observe(credits.AddComponent <PileCount>());
        }
Exemplo n.º 2
0
 public HeapPile(GameObject gameObject, Game game, BoardParts parts)
 {
     this.gameObject = gameObject;
     this.printer    = parts.Print(gameObject);
     this.DropZone   = gameObject.AddComponent <DropZone>();
     game.runner.zones.heap.zone.ObserveAdditions(this);
 }
Exemplo n.º 3
0
    void Start()
    {
        var board      = GameObject.Find("/Board");
        var perception = new RunnerPerception();
        var zoom       = new CardZoom(board, perception);
        var parts      = new BoardParts(board, perception, zoom);
        var corpPlayer = new Player(
            deck: new Decks().DemoCorp(),
            pilot: new CorpAi(new System.Random(1234))
            );
        var runnerPlayer = new Player(
            deck: new Decks().DemoRunner(),
            pilot: new CardPickingPilot(
                new CardChoiceScreen(parts),
                new TrashingPilot(
                    new TrashChoiceScreen(parts),
                    new AutoPaidWindowPilot(
                        new SingleChoiceMaker(
                            new NoPilot()
                            )
                        )
                    )
                )
            );
        var game     = new Game(corpPlayer, runnerPlayer, new Shuffling(10006));
        var flowView = new GameFlowView();
        var flowLog  = new GameFlowLog();

        flowView.Display(board, game);
        flowLog.Display(game);
        var corpView = new CorpViewConfig().Display(game, parts);

        new RunnerViewConfig().Display(game, flowView, corpView, parts);
        game.Start();
    }
Exemplo n.º 4
0
 public RigGrid(GameObject gameObject, Game game, DropZone paidWindowTrigger, BoardParts parts)
 {
     this.game = game;
     this.paidWindowTrigger = paidWindowTrigger;
     this.printer           = parts.Print(gameObject);
     game.runner.paidWindow.ObserveAbility(this);
     game.runner.zones.rig.zone.ObserveAdditions(this);
     game.runner.zones.rig.zone.ObserveRemovals(this);
     this.DropZone = gameObject.AddComponent <DropZone>();
 }
Exemplo n.º 5
0
        public ServerBox(GameObject gameObject, IServer server, BoardParts parts)
        {
            this.gameObject = gameObject;
            this.server     = server;
            var image = gameObject.AddComponent <Image>();

            image.sprite     = Resources.Load <Sprite>("Images/UI/9slice-solid-white");
            image.type       = Image.Type.Sliced;
            image.fillCenter = false;
            image.color      = new Color(1f, 1f, 1f, 0f);
            Printer          = parts.Print(gameObject);
        }
Exemplo n.º 6
0
 public ServerRow(GameObject gameObject, BoardParts parts, Zones zones)
 {
     this.gameObject               = gameObject;
     this.parts                    = parts;
     layout                        = gameObject.AddComponent <HorizontalLayoutGroup>();
     layout.childControlWidth      = true;
     layout.childControlHeight     = true;
     layout.childForceExpandWidth  = true;
     layout.childForceExpandHeight = true;
     layout.childAlignment         = TextAnchor.UpperLeft;
     layout.spacing                = 4;
     zones.ObserveRemotes(this);
 }
Exemplo n.º 7
0
        private CardPrinter CreateSubjectRow(GameObject blanket, BoardParts parts)
        {
            var subjectRow = new GameObject("Subject row")
            {
                layer = 5
            };

            subjectRow.transform.SetParent(blanket.transform);
            var rectangle = subjectRow.AddComponent <RectTransform>();

            rectangle.anchorMin = new Vector2(0.1f, 0.5f);
            rectangle.anchorMax = new Vector2(0.9f, 1.0f);
            rectangle.offsetMin = Vector2.zero;
            rectangle.offsetMax = Vector2.zero;
            return(parts.Print(subjectRow));
        }
Exemplo n.º 8
0
        public StackPile(GameObject gameObject, Game game, DropZone gripZone, BoardParts parts)
        {
            this.game     = game;
            this.gripZone = gripZone;
            top           = parts.Print(gameObject).PrintRunnerFacedown("Top of stack");
            top.transform.SetAsFirstSibling();
            top.transform.rotation *= Quaternion.Euler(0.0f, 0.0f, 90.0f);
            var rect = top.GetComponent <RectTransform>();

            rect.anchoredPosition = new Vector3(0.0f, 0.0f, 0.0f);
            top
            .AddComponent <Droppable>()
            .Represent(
                new InteractiveAbility(game.runner.actionCard.draw, gripZone, game)
                );
            game.runner.zones.stack.zone.ObserveCount(gameObject.AddComponent <PileCount>());
        }
Exemplo n.º 9
0
        private CardPrinter CreateOptionsRow(GameObject blanket, BoardParts parts)
        {
            var optionsRow = new GameObject("Options row")
            {
                layer = 5
            };

            optionsRow.transform.SetParent(blanket.transform);
            var rectangle = optionsRow.AddComponent <RectTransform>();

            rectangle.anchorMin = new Vector2(0.1f, 0.0f);
            rectangle.anchorMax = new Vector2(0.9f, 0.5f);
            rectangle.offsetMin = Vector2.zero;
            rectangle.offsetMax = Vector2.zero;
            var horizontalLayout = optionsRow.AddComponent <HorizontalLayoutGroup>();

            horizontalLayout.spacing = 200;
            return(parts.Print(optionsRow));
        }
Exemplo n.º 10
0
        public CorpView Display(Game game, BoardParts parts)
        {
            var zones   = game.corp.zones;
            var credits = GameObject.Find("Corp/Credits");

            game.corp.credits.Observe(credits.AddComponent <CreditSpiral>());
            game.corp.credits.Observe(credits.AddComponent <PileCount>());
            var servers     = new ServerRow(GameObject.Find("Servers"), parts, zones);
            var archivesBox = servers.Box(zones.archives);

            archivesBox.Printer.Sideways = true;
            var rd = servers.Box(zones.rd).Printer.PrintCorpFacedown("Top of R&D");
            var hq = servers.Box(zones.hq).Printer.Print(game.corp.identity);

            zones.archives.Zone.ObserveCount(archivesBox.gameObject.AddComponent <PileCount>()); // TODO renders under the pile due to children-order
            zones.archives.Zone.ObserveAdditions(archivesBox);
            zones.archives.Zone.ObserveRemovals(archivesBox);
            zones.hq.Zone.ObserveCount(hq.AddComponent <PileCount>());
            zones.rd.Zone.ObserveCount(rd.AddComponent <PileCount>());
            return(new CorpView(servers));
        }
Exemplo n.º 11
0
 public CardChoiceScreen(BoardParts parts)
 {
     blanket    = CreateBlanket(parts.board);
     subjectRow = CreateSubjectRow(blanket, parts);
     optionsRow = CreateOptionsRow(blanket, parts);
 }
Exemplo n.º 12
0
 public GripFan(GameObject gameObject, Game game, DropZone playZone, DropZone rigZone, DropZone heapZone, BoardParts parts)
 {
     this.gameObject = gameObject;
     this.game       = game;
     this.playZone   = playZone;
     this.rigZone    = rigZone;
     this.heapZone   = heapZone;
     this.printer    = parts.Print(gameObject);
     this.DropZone   = gameObject.AddComponent <DropZone>();
     game.runner.zones.grip.zone.ObserveAdditions(this);
     game.runner.zones.grip.zone.ObserveRemovals(this);
 }
Exemplo n.º 13
0
 public ZoneBox(GameObject gameObject, BoardParts parts)
 {
     this.gameObject = gameObject;
     Printer         = parts.Print(gameObject);
 }