public PartnerBattleMenu(BattleEntity user, ActionSubMenu partnerSubMenu, PartnerTypes partnerType) : base(user) { PartnerSubMenu = partnerSubMenu; PartnerType = partnerType; Texture2D abilityTex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"); CroppedTexture2D partnerIcon = new CroppedTexture2D(abilityTex, new Rectangle(30 + (((int)PartnerType - 1) * 32), 886, 32, 32)); ActionButtons.Add(new ActionButton("Abilities", partnerIcon, MoveCategories.Partner, PartnerSubMenu)); //Add Focus to the Partner battle menu if the Group Focus badge is equipped int groupFocusCount = User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.GroupFocus); if (groupFocusCount > 0) { ActionSubMenu focusMenu = new ActionSubMenu(user, "Focus", new FocusAction(user)); focusMenu.AutoSelectSingle = true; CroppedTexture2D starPower = new CroppedTexture2D(abilityTex, new Rectangle(182, 812, 24, 24)); ActionButtons.Add(new ActionButton("Focus", starPower, MoveCategories.Special, focusMenu)); } Initialize(2); }
/// <summary> /// Gets a particular Partner in the party. /// </summary> /// <param name="partnerType">The PartnerType of the Partner.</param> /// <returns>A BattlePartner with the specified PartnerType if it exists in the party, otherwise null.</returns> public BattlePartner GetPartner(PartnerTypes partnerType) { BattlePartner partner = null; Partners.TryGetValue(partnerType, out partner); return(partner); }
/// <summary> /// Gets a particular Partner in the party. /// </summary> /// <param name="partner">The PartnerType of the Partner.</param> /// <returns>A BattlePartner with the specified PartnerType if it exists in the party, otherwise null.</returns> public BattlePartner GetPartner(PartnerTypes partner) { if (HasPartner(partner) == true) { return(Partners[partner]); } else { return(null); } }
/// <summary> /// Removes a Partner from the party. /// </summary> /// <param name="partnerType">The PartnerType of the Partner.</param> public void RemovePartner(PartnerTypes partnerType) { BattlePartner battlePartner = GetPartner(partnerType); if (battlePartner == null) { Debug.LogError($"Mario doesn't have {partnerType} as a Partner, so he/she cannot be removed from the party"); return; } Partners.Remove(partnerType); }
/// <summary> /// Removes a Partner from the party. /// </summary> /// <param name="partner">The PartnerType of the Partner.</param> public void RemovePartner(PartnerTypes partner) { if (HasPartner(partner) == false) { Debug.LogError($"Mario doesn't have {partner} as a Partner, so he/she cannot be from the party"); return; } BattlePartner battlePartner = GetPartner(partner); Partners.Remove(partner); ////If the last partner that left the party was the current active one, get another Partner to be active //if (battlePartner == ActivePartner) //{ // SetActivePartner(GetNextPartner()); //} }
/// <summary> /// Tells whether a particular Partner is in the party or not. /// </summary> /// <param name="partner">The PartnerTypes of the Partner.</param> /// <returns>true if a BattlePartner with the specified PartnerType is in the party, otherwise false.</returns> public bool HasPartner(PartnerTypes partner) { return(Partners.ContainsKey(partner)); }
public void AddToPartnerTypes(PartnerTypes partnerTypes) { base.AddObject("PartnerTypes", partnerTypes); }
public static PartnerTypes CreatePartnerTypes(int ID, string title, byte[] rowVersion) { PartnerTypes partnerTypes = new PartnerTypes(); partnerTypes.Id = ID; partnerTypes.Title = title; partnerTypes.RowVersion = rowVersion; return partnerTypes; }