// private IImageSettingsProvider imageSettingsProvider; public ImageSettingsAction(IImageHolder imageHolder, ImageSettings imageSettings, SettingsManager manager) { this.imageHolder = imageHolder; this.imageSettings = imageSettings; this.manager = manager; // this.imageSettingsProvider = provider; }
public void ShowDecisionDescription(string title, string description, IImageHolder imageSource = null) { if (title != null) { DecisionPanel.transform.Find("AbilityName").GetComponent <Text>().text = title; if (DescriptionLong != null) { DecisionPanel.transform.Find("DescriptionHolder/Description").GetComponent <Text>().text = description; if (imageSource != null) { DecisionPanel.transform.Find("DescriptionHolder/CardImage").GetComponent <SmallCardArt>().Initialize(imageSource); } else { DecisionPanel.transform.Find("DescriptionHolder/CardImage").gameObject.SetActive(false); DecisionPanel.transform.Find("DescriptionHolder/Description").GetComponent <RectTransform>().sizeDelta = new Vector2(680, 100); } } else { DecisionPanel.transform.Find("DescriptionHolder").gameObject.SetActive(false); DecisionPanel.transform.Find("Center").localPosition += new Vector3(0, 120, 0); } } }
public DragonPainter(IImageHolder imageHolder, DragonSettings settings) { this.imageHolder = imageHolder; this.settings = settings; imageSize = imageHolder.GetImageSize(); size = Math.Min(imageSize.Width, imageSize.Height) / 2.1f; }
public KochPainter(IImageHolder imageHolder, Palette palette) { this.imageHolder = imageHolder; this.palette = palette; //imageHolder.RecreateImage(imageSettings); //imageSize = imageHolder.GetImageSize(); }
public DragonFractalAction(IImageHolder imageHolder, IDragonPainterFactory painterFactory, Func <Random, DragonSettingsGenerator> settingsFactoryFunc) { this.imageHolder = imageHolder; this.painterFactory = painterFactory; this.settingsFactoryFunc = settingsFactoryFunc; }
public TagCreator(FontSettings fontSettings, ICloudLayouter cloudLayouter, TextAnalyzer textAnalyzer, IImageHolder imageHolder) { this.fontSettings = fontSettings; this.cloudLayouter = cloudLayouter; this.textAnalyzer = textAnalyzer; this.imageHolder = imageHolder; }
public DragonFractalAction(IImageHolder imageHolder, IDragonPainterFactory dragonPainterFactory, Func <DragonSettingsGenerator> dragonSettingsGeneratorFactory) { this.imageHolder = imageHolder; this.dragonPainterFactory = dragonPainterFactory; this.dragonSettingsGeneratorFactory = dragonSettingsGeneratorFactory; }
public SyncService(IUserRepository userRepository, IPresentationRepository presentationRepository, IImageHolder imageHolder) { _userRepository = userRepository; _presentationRepository = presentationRepository; _imageHolder = imageHolder; }
public TagCloudPainter(IImageHolder holder, ImageSettings imageSettings, Palette palette, FontSettings fontSettings) { this.holder = holder; this.imageSettings = imageSettings; this.palette = palette; this.fontSettings = fontSettings; }
public CloudPainter(IImageHolder imageHolder, ICircularCloudLayouterSettings settings, IPalette palette, ICircularCloudLayouter layouter) { this.imageHolder = imageHolder; this.settings = settings; this.palette = palette; this.layouter = layouter; this.rnd = new Random(); imageSize = imageHolder.GetImageSize(); }
public CloudPainterFactory(IImageHolder imageHolder, IPalette palette, CircularCloudLayouterSettings.ICircularCloudLayouterSettings settings, Func <Point, ICircularCloudLayouter> makeLayouter) { this.imageHolder = imageHolder; this.palette = palette; this.makeLayouter = makeLayouter; this.settings = settings; }
public CloudWithWordsPainter(IImageHolder imageHolder, ICircularCloudLayouterWithWordsSettings settings, IPalette palette, ICircularCloudLayouter layouter, Dictionary <string, int> words) { this.imageHolder = imageHolder; this.settings = settings; this.palette = palette; this.layouter = layouter; this.words = words; imageSize = imageHolder.GetImageSize(); }
public void Initialize(IImageHolder imageSource) { ImageSource = imageSource; ImageUrl = ImageSource.ImageUrl; this.gameObject.SetActive(false); if (ImageUrl != null) { LoadImage(); } }
public void Initialize(IImageHolder imageSource) { ImageSource = imageSource; ImageUrl = ImageSource.ImageUrl; this.gameObject.SetActive(false); textureCacheKey = TEXTURENAME + ImageUrl; if (ImageUrl != null) { LoadTooltipImage(gameObject, ImageUrl); } }
public void PrepareByParameters(Action <GenericObstacle> selectTargetAction, Func <GenericObstacle, bool> filterTargets, PlayerNo subphaseOwnerPlayerNo, bool showSkipButton, string abilityName, string description, IImageHolder imageSource = null) { SelectTargetAction = selectTargetAction; FilterTargets = filterTargets; RequiredPlayer = subphaseOwnerPlayerNo; if (showSkipButton) { UI.ShowSkipButton(); } AbilityName = abilityName; Description = description; ImageSource = imageSource; }
/// <summary> /// Shows "Take a decision" window for ability with various buttons /// </summary> public void AskForDecision( string descriptionShort, string descriptionLong = null, IImageHolder imageHolder = null, Dictionary <string, EventHandler> decisions = null, Dictionary <string, string> tooltips = null, string defaultDecision = null, Action callback = null, bool showSkipButton = true, PlayerNo requiredPlayer = PlayerNo.PlayerNone ) { if (callback == null) { callback = Triggers.FinishTrigger; } DecisionSubPhase pilotAbilityDecision = (DecisionSubPhase)Phases.StartTemporarySubPhaseNew( Name, typeof(AbilityDecisionSubphase), callback ); pilotAbilityDecision.DescriptionShort = descriptionShort; pilotAbilityDecision.DescriptionLong = descriptionLong; pilotAbilityDecision.ImageSource = imageHolder; pilotAbilityDecision.RequiredPlayer = (requiredPlayer == PlayerNo.PlayerNone) ? HostShip.Owner.PlayerNo : requiredPlayer; foreach (var decision in decisions) { pilotAbilityDecision.AddDecision( decision.Key, delegate { DecisionSubPhase.ConfirmDecisionNoCallback(); decision.Value.Invoke(null, null); } ); } foreach (var tooltip in tooltips) { pilotAbilityDecision.AddTooltip(tooltip.Key, tooltip.Value); } pilotAbilityDecision.DefaultDecisionName = defaultDecision; pilotAbilityDecision.ShowSkipButton = showSkipButton; pilotAbilityDecision.Start(); }
public static bool Initialize(IImageHolder imageHolder, IEncryptable encryptable, ICompressible compressible) { try { _imageHolder = imageHolder; _imageEncryptor = encryptable; _imageComprosser = compressible; return(true); } catch (Exception e) { throw new ArgumentException("Arguments can't match the correct types!"); } }
public CloudWithWordsPainterFactory(IImageHolder imageHolder, IPalette palette, ICircularCloudLayouterWithWordsSettings settings, ITextReader textReader, Func <Point, ICircularCloudLayouter> makeLayouter, IWordsFilter[] filters, IWordsFrequencyParser parser) { this.imageHolder = imageHolder; this.palette = palette; this.makeLayouter = makeLayouter; this.settings = settings; this.filters = filters; this.parser = parser; this.textReader = textReader; }
public void SetUp() { imageHolder = A.Fake <IImageHolder>(); settings = A.Fake <ICircularCloudLayouterWithWordsSettings>(); palette = A.Fake <IPalette>(); layouter = A.Fake <ICircularCloudLayouter>(); graphics = A.Fake <IGraphicDrawer>(); A.CallTo(() => imageHolder.GetImageSize()).Returns(new Size(600, 600)); A.CallTo(() => imageHolder.StartDrawing()).Returns(graphics); A.CallTo(() => settings.CenterX).Returns(300); A.CallTo(() => settings.Scale).Returns(5); A.CallTo(() => settings.CenterY).Returns(300); A.CallTo(() => palette.PrimaryColor).Returns(Color.Black); A.CallTo(() => palette.BackgroundColor).Returns(Color.Black); A.CallTo(() => palette.SecondaryColor).Returns(Color.Black); }
public void ShowSubphaseDescription(string title, string description, IImageHolder imageSource = null) { HideSubphaseDescription(); if (Roster.GetPlayer(RequiredPlayer).GetType() == typeof(HumanPlayer) && title != null) { GameObject subphaseDescriptionGO = GameObject.Find("UI").transform.Find("CurrentSubphaseDescription" + ((imageSource != null) ? "" : "NoImage")).gameObject; subphaseDescriptionGO.transform.Find("AbilityName").GetComponent <Text>().text = title; subphaseDescriptionGO.transform.Find("DescriptionHolder/Description").GetComponent <Text>().text = description; if (imageSource != null) { subphaseDescriptionGO.transform.Find("DescriptionHolder/CardImage").GetComponent <SmallCardArt>().Initialize(imageSource); } subphaseDescriptionGO.SetActive(true); } }
public void PrepareByParameters(Action selectTargetAction, Func <GenericShip, bool> filterTargets, Func <GenericShip, int> getAiPriority, PlayerNo subphaseOwnerPlayerNo, bool showSkipButton, string abilityName, string description, IImageHolder imageSource = null) { FilterShipTargets = filterTargets; GetAiPriority = getAiPriority; finishAction = selectTargetAction; RequiredPlayer = subphaseOwnerPlayerNo; if (showSkipButton) { UI.ShowSkipButton(); } else { UI.HideSkipButton(); } DescriptionShort = abilityName; DescriptionLong = description; ImageSource = imageSource; }
public void SetUp() { imageHolder = A.Fake <IImageHolder>(); settings = A.Fake <ICircularCloudLayouterSettings>(); palette = A.Fake <IPalette>(); layouter = A.Fake <ICircularCloudLayouter>(); graphics = A.Fake <IGraphicDrawer>(); A.CallTo(() => imageHolder.GetImageSize()).Returns(new Size(600, 600)); A.CallTo(() => imageHolder.StartDrawing()).Returns(graphics); A.CallTo(() => settings.MinSize).Returns(10); A.CallTo(() => settings.MaxSize).Returns(30); A.CallTo(() => settings.CenterX).Returns(300); A.CallTo(() => settings.CenterY).Returns(300); A.CallTo(() => settings.IterationsCount).Returns(5); A.CallTo(() => settings.XCompression).Returns(1); A.CallTo(() => settings.YCompression).Returns(1); A.CallTo(() => palette.PrimaryColor).Returns(Color.Black); A.CallTo(() => palette.BackgroundColor).Returns(Color.Black); A.CallTo(() => palette.SecondaryColor).Returns(Color.Black); }
public void SaveImage(IImageHolder holder) { if (holder != null) { var file = _saveFileIO.Show(new IODialogInfo() { Title = "Save Elevation Chart Image", Filters = new[] { "PNG Images|*.png", "BMP Images|*.bmp" } }); if (!String.IsNullOrEmpty(file)) { var imageFormat = System.Drawing.Imaging.ImageFormat.Png; if (file.EndsWith(".bmp")) { imageFormat = System.Drawing.Imaging.ImageFormat.Bmp; } var image = holder.GetImage(imageFormat); image.Save(file, imageFormat); } } }
// Extra Attacks public static void StartSelectAttackTarget ( GenericShip ship, Action callback, Func <GenericShip, IShipWeapon, bool, bool> extraAttackFilter = null, string abilityName = null, string description = null, IImageHolder imageSource = null, bool showSkipButton = true, Action <Action> payAttackCost = null ) { Selection.ChangeActiveShip("ShipId:" + ship.ShipId); Phases.CurrentSubPhase.RequiredPlayer = ship.Owner.PlayerNo; ExtraAttackFilter = extraAttackFilter; PayExtraAttackCost = payAttackCost; SelectTargetForAttackSubPhase newAttackSubphase = (SelectTargetForAttackSubPhase)Phases.StartTemporarySubPhaseNew( "Second attack", typeof(SelectTargetForAttackSubPhase), delegate { ship.CallAfterAttackWindow(); Phases.FinishSubPhase(typeof(SelectTargetForAttackSubPhase)); CameraScript.RestoreCamera(); callback(); } ); newAttackSubphase.DescriptionShort = abilityName; newAttackSubphase.DescriptionLong = description; newAttackSubphase.ImageSource = imageSource; newAttackSubphase.ShowSkipButton = showSkipButton; newAttackSubphase.Start(); }
/// <summary> /// Shows "Take a decision" window for ability with Yes / No buttons to Opponent /// </summary> protected void AskOpponent( Func <bool> aiUseByDefault, EventHandler useAbility, EventHandler dontUseAbility = null, string descriptionShort = null, string descriptionLong = null, IImageHolder imageSource = null, bool showSkipButton = true ) { if (dontUseAbility == null) { dontUseAbility = DontUseAbility; } DecisionSubPhase opponentDecision = (DecisionSubPhase)Phases.StartTemporarySubPhaseNew( Name, typeof(AbilityDecisionSubphase), Triggers.FinishTrigger ); opponentDecision.DescriptionShort = descriptionShort ?? "Allow to use " + Name + "?"; opponentDecision.DescriptionLong = descriptionLong ?? null; opponentDecision.ImageSource = imageSource ?? null; opponentDecision.RequiredPlayer = Roster.AnotherPlayer(HostShip.Owner.PlayerNo); opponentDecision.AddDecision("Yes", useAbility); opponentDecision.AddDecision("No", dontUseAbility); opponentDecision.DefaultDecisionName = (aiUseByDefault()) ? "Yes" : "No"; opponentDecision.ShowSkipButton = showSkipButton; opponentDecision.Start(); }
public void SetDependency(IImageHolder dependency) { imageHolder = dependency; }
public ImageSettingsAction(ImageSettings imageSettings, IImageHolder imageHolder) { this.imageSettings = imageSettings; this.imageHolder = imageHolder; }
public SaveImageAction(IImageDirectoryProvider imageDirectoryProvider, IImageHolder imageHolder) { this.imageDirectoryProvider = imageDirectoryProvider; this.imageHolder = imageHolder; }
public ImageSettingsAction(IImageHolder imageHolder, AppSettings appSettings) { this.imageHolder = imageHolder; this.appSettings = appSettings; }
public ImageSettingsAction(IImageHolder imageHolder, ImageSettings imageSettings) { this.imageHolder = imageHolder; this.imageSettings = imageSettings; }
public BootViewModel(IImageHolder imageHolder) { _imageHolder = imageHolder; }
public CameraRendererViewModel(IImageHolder imageHolder) { _imageHolder = imageHolder; }