private InteractiveChoice <Card> DisplayOption(Card option, string q, GameObject subject) { var optionCard = optionsRow.Print(option); var dropZone = optionCard.AddComponent <DropZone>(); var choice = new InteractiveChoice <Card>(option, true, dropZone, optionCard); subject.AddComponent <Droppable>().Represent(choice); return(choice); }
private InteractiveChoice <ITrashOption> DisplayOption(ITrashOption option, Card card, GameObject subject, Game game) { var optionCard = new GameObject("Trash option " + option); var image = optionCard.AddComponent <Image>(); image.sprite = Resources.Load <Sprite>(option.Art); image.preserveAspect = true; var rectangle = image.rectTransform; rectangle.SetSizeWithCurrentAnchors(Axis.Horizontal, 100); rectangle.SetSizeWithCurrentAnchors(Axis.Vertical, 100); optionCard.transform.SetParent(optionsRow.transform); var dropZone = optionCard.AddComponent <DropZone>(); bool legal = option.IsLegal(game); var choice = new InteractiveChoice <ITrashOption>(option, legal, optionCard); subject.AddComponent <Droppable>().Represent(choice, dropZone); return(choice); }