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>()); }
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); }
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(); }
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>(); }
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); }
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); }
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)); }
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>()); }
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)); }
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)); }
public CardChoiceScreen(BoardParts parts) { blanket = CreateBlanket(parts.board); subjectRow = CreateSubjectRow(blanket, parts); optionsRow = CreateOptionsRow(blanket, parts); }
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); }
public ZoneBox(GameObject gameObject, BoardParts parts) { this.gameObject = gameObject; Printer = parts.Print(gameObject); }