public GetButtonImageRequest(CardGroupId cardGroup, ButtonMode?buttonMode, int?zoneIndex, int?index) { CardGroupId = cardGroup; ButtonMode = buttonMode; ZoneIndex = zoneIndex; Index = index; }
public GetButtonInfoRequest(CardGroupId cardGroup, ButtonMode buttonMode, int zoneIndex, int index) { CardGroupId = cardGroup; ButtonMode = buttonMode; ZoneIndex = zoneIndex; Index = index; }
public CardInfoButton(CardInfo cardInfo, CardGroupId cardGroupId) : base(cardInfo, false) { if (cardInfo.IsPlayerCard) { Options.Add(new ButtonOption(ButtonOptionOperation.Add, cardGroupId, zoneIndex: 0)); } if (cardInfo.Type == CardType.Act || cardInfo.Type == CardType.Agenda) { Options.Add(new ButtonOption(ButtonOptionOperation.Add, cardGroupId, zoneIndex: 0)); } if (!cardInfo.IsPlayerCard && cardInfo.IsHidden) { Options.Add(new ButtonOption(ButtonOptionOperation.Add, CardGroupId.Player1, zoneIndex: 0)); Options.Add(new ButtonOption(ButtonOptionOperation.Add, CardGroupId.Player2, zoneIndex: 0)); Options.Add(new ButtonOption(ButtonOptionOperation.Add, CardGroupId.Player3, zoneIndex: 0)); Options.Add(new ButtonOption(ButtonOptionOperation.Add, CardGroupId.Player4, zoneIndex: 0)); } if (!cardInfo.IsHidden && cardInfo.Type == CardType.Treachery || cardInfo.Type == CardType.Enemy || cardInfo.Type == CardType.Location) { Options.Add(new ButtonOption(ButtonOptionOperation.Add, CardGroupId.Player1, zoneIndex: 1)); Options.Add(new ButtonOption(ButtonOptionOperation.Add, CardGroupId.Player2, zoneIndex: 1)); Options.Add(new ButtonOption(ButtonOptionOperation.Add, CardGroupId.Player3, zoneIndex: 1)); Options.Add(new ButtonOption(ButtonOptionOperation.Add, CardGroupId.Player4, zoneIndex: 1)); } }
public ButtonRemoved(CardGroupId cardGroupId, ButtonMode buttonMode, int zoneIndex, int index) { CardGroupId = cardGroupId; ButtonMode = buttonMode; ZoneIndex = zoneIndex; Index = index; }
public CardGroupChanged(CardGroupId cardGroupId, string name, bool isImageAvailable, string imageId, IList <string> zones) { CardGroupId = cardGroupId; Name = name; IsImageAvailable = isImageAvailable; ImageId = imageId; Zones = zones; }
public ButtonToggled(CardGroupId cardGroupId, ButtonMode buttonMode, int zoneIndex, int index, bool isToggled) { CardGroupId = cardGroupId; ButtonMode = buttonMode; ZoneIndex = zoneIndex; Index = index; IsToggled = isToggled; }
public ButtonClickRequest(CardGroupId cardGroupId, ButtonMode buttonMode, int zoneIndex, int index, MouseButton mouseButton, ButtonOption buttonOption) { CardGroupId = cardGroupId; ButtonMode = buttonMode; ZoneIndex = zoneIndex; Index = index; MouseButton = mouseButton; ButtonOption = buttonOption; }
public CardGroup(CardGroupId id) { Type = id.GetSelectableType(); Id = id; CardButtons = new List <IButton>(); _cardZones = new List <CardZone>(); _eventBus.SubscribeToCardInfoVisibilityChanged(CardInfoVisibilityChangedHandler); }
/// <summary> /// Update all actions to make sure they show the proper information /// </summary> /// <param name="buttonMode">Refresh buttons in this card group</param> /// <param name="buttonMode">Refresh buttons in this mode</param> public void RefreshAllActions(CardGroupId cardGroupId, ButtonMode buttonMode) { IList <DynamicAction> allActions; lock (_dynamicActionsLock) { allActions = _dynamicActions.ToList(); } foreach (var action in allActions.Where(x => x.CardGroupId == cardGroupId && x.ButtonMode == buttonMode)) { action.UpdateButtonToNewDynamicAction(); } }
public ButtonInfoChanged(CardGroupId cardGroupId, ButtonMode buttonMode, int zoneIndex, int index, string name, string code, bool isToggled, bool imageAvailable, ChangeAction action, IList <ButtonOption> buttonOptions) { CardGroupId = cardGroupId; ButtonMode = buttonMode; ZoneIndex = zoneIndex; Index = index; Name = name; Code = code; IsToggled = isToggled; ImageAvailable = imageAvailable; Action = action; ButtonOptions = buttonOptions; }
/// <summary> /// Check to see if this image is stored- if it is not, retrieve it /// </summary> /// <param name="imageId">Id of the image in the cache- used to store and retrieve it</param> /// <param name="cardGroupId">Card Group for the image</param> /// <param name="buttonMode">ButtonMode for the image- may be null if the image is for the Card Group </param> /// <param name="zoneIndex">Zone Index of the image- may be null if the image is for the Card Group</param> /// <param name="index">Index of the image- may be null if the image is for the Card Group</param> public void LoadImage(string imageId, CardGroupId cardGroupId, ButtonMode?buttonMode = null, int?zoneIndex = null, int?index = null) { if (string.IsNullOrEmpty(imageId)) { return; } if (HasImage(imageId)) { return; } _eventBus.PublishGetButtonImageRequest(cardGroupId, buttonMode, zoneIndex, index); }
private Player GetPlayer(CardGroupId cardGroup) { switch (cardGroup) { case CardGroupId.Player1: return(_appData.Game.Players[0]); case CardGroupId.Player2: return(_appData.Game.Players[1]); case CardGroupId.Player3: return(_appData.Game.Players[2]); case CardGroupId.Player4: return(_appData.Game.Players[3]); default: return(_appData.Game.Players[0]); } }
public Player(CardGroupId deck) { CardGroup = new CardGroup(deck); CardGroup.AddCardZone(new CardZone("Hand", CardZoneLocation.Bottom)); CardGroup.AddCardZone(new CardZone("Threat Area", CardZoneLocation.Bottom)); CardGroup.AddCardZone(new CardZone("Tableau", CardZoneLocation.Bottom)); Health = new Stat(StatType.Health, deck); Sanity = new Stat(StatType.Sanity, deck); Resources = new Stat(StatType.Resources, deck); Clues = new Stat(StatType.Clues, deck); Faction = Faction.Other; Resources.Value = 5; _eventBus.SubscribeToStatTrackingVisibilityChangedEvent(e => { _isStatTrackingVisible = e.IsVisible; NotifyPropertyChanged(nameof(StatTrackingVisibility)); }); }
public static CardGroupType GetSelectableType(this CardGroupId deck) { switch (deck) { case CardGroupId.Player1: case CardGroupId.Player2: case CardGroupId.Player3: case CardGroupId.Player4: return(CardGroupType.Player); case CardGroupId.Scenario: return(CardGroupType.Scenario); case CardGroupId.Locations: return(CardGroupType.Location); case CardGroupId.EncounterDeck: return(CardGroupType.Encounter); default: return(CardGroupType.Player); } }
public static void PublishGetButtonImageRequest(this IEventBus eventBus, CardGroupId cardGroup, ButtonMode?buttonMode, int?zoneIndex, int?index) { eventBus.Publish(new GetButtonImageRequest(cardGroup, buttonMode, zoneIndex, index)); }
public StatUpdated(CardGroupId cardGroupId, StatType statType, int value) { CardGroupId = cardGroupId; StatType = statType; Value = value; }
public static void PublishStatUpdated(this IEventBus eventBus, CardGroupId cardGroupId, StatType statType, int value) { eventBus.Publish(new StatUpdated(cardGroupId, statType, value)); }
public ChangeStatValueRequest(CardGroupId deck, StatType statType, bool increase) { Deck = deck; StatType = statType; Increase = increase; }
public static void PublishChangeStatValueRequest(this IEventBus eventBus, CardGroupId deck, StatType statType, bool increase) { eventBus.Publish(new ChangeStatValueRequest(deck, statType, increase)); }
public static void PublishGetStatValueRequest(this IEventBus eventBus, CardGroupId deck, StatType statType) { eventBus.Publish(new GetStatValueRequest(deck, statType)); }
public static void PublishButtonToggled(this IEventBus eventBus, CardGroupId cardGroupId, ButtonMode buttonMode, int zoneIndex, int index, bool isToggled) { eventBus.Publish(new ButtonToggled(cardGroupId, buttonMode, zoneIndex, index, isToggled)); }
public void ShowDeckList(CardGroupId id) { _logger.LogMessage("Main window: show deck list clicked."); _eventBus.PublishShowDeckListRequest(id); }
public CardGroupButtonsChanged(CardGroupId cardGroupId, IList <ButtonInfo> buttons) { CardGroupId = cardGroupId; Buttons = buttons; }
public static void PublishButtonClickRequest(this IEventBus eventBus, CardGroupId cardGroupId, ButtonMode buttonMode, int zoneIndex, int index, MouseButton mouseButton, ButtonOption buttonOption = null) { eventBus.Publish(new ButtonClickRequest(cardGroupId, buttonMode, zoneIndex, index, mouseButton, buttonOption)); }
public IEnumerable <IDynamicActionInfo> GetDynamicActionInfoForGroup(CardGroupId cardGroupId) { lock (_cacheLock) { return(_dynamicActionInfoList.Where(x => x.CardGroupId == cardGroupId).ToList()); } }
/// <summary> /// Retrieve Card group Info from the store /// </summary> /// <param name="cardGroupId">Id of the card group info to retrieve</param> /// <returns>Card group info</returns> public ICardGroupInfo GetCardGroupInfo(CardGroupId cardGroupId) { if (!_cardGroupInfoCache.ContainsKey(cardGroupId)) { return(default);
public GetStatValueRequest(CardGroupId deck, StatType statType) { Deck = deck; StatType = statType; }
public static void PublishCardGroupChanged(this IEventBus eventBus, CardGroupId cardGroupId, string name, bool isImageAvailable, string imageId, IList <string> zones) { eventBus.Publish(new CardGroupChanged(cardGroupId, name, isImageAvailable, imageId, zones)); }
public ShowDeckListRequest(CardGroupId cardGroupId) { CardGroupId = cardGroupId; }
public static void PublishCardGroupButtonsChanged(this IEventBus eventBus, CardGroupId cardGroupId, IList <ButtonInfo> buttons) { eventBus.Publish(new CardGroupButtonsChanged(cardGroupId, buttons)); }